NativeScript / NativeScript/plugins
Error DateTimePicker in module @nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 206
- Fork
- 123
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Hello,
I have a problem when building my project with nativescript angular
The error :
ERROR in ./node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs
Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string 'D:\GitHub\tina\TinaAppV2\node_modules\@nativescript\datetimepicker\angular\fesm2015\nativescript-datetimepicker-angular.mjs: This application depends upon a library published using Angular version 14.0.4, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.
8 | }
9 | DatePickerFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DatePickerFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
> 10 | DatePickerFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: DatePickerFieldDirective, selector: "DatePickerField", ngImport: i0 });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DatePickerFieldDirective, decorators: [{
12 | type: Directive,
13 | args: [{'
at run (D:\GitHub\tina\TinaAppV2\node_modules\@babel\core\lib\transformation\index.js:37:15)
at run.next (<anonymous>)
at Function.transform (D:\GitHub\tina\TinaAppV2\node_modules\@babel\core\lib\transform.js:25:41)
at transform.next (<anonymous>)
at step (D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:261:32)
at D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:273:13
at async.call.result.err.err (D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:223:11)
at D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:37:40
@ ./src/app/app.module.ts 4:0-88 24:12-44
@ ./src/main.ts 4:0-45 6:69-78
webpack 5.70.0 compiled with 1 error in 39620 ms
Webpack compilation complete. Watching for file changes.
File change detected. Starting incremental webpack compilation...
assets by status 20.5 MiB [cached] 49 assets
assets by path . 88.5 KiB
asset runtime.js 87.7 KiB [emitted] (name: runtime)
asset runtime.d05486ba579ffe17e097.hot-update.js 736 bytes [emitted] [immutable] [hmr] (name: runtime)
asset runtime.d05486ba579ffe17e097.hot-update.json 31 bytes [emitted] [immutable] [hmr]
Entrypoint bundle 19.7 MiB = runtime.js 87.7 KiB runtime.d05486ba579ffe17e097.hot-update.js 736 bytes vendor.js 17.5 MiB bundle.js 2.18 MiB
cached modules 6.59 MiB [cached] 742 modules
runtime modules 25.2 KiB 13 modules
./node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs 39 bytes [built] [1 error]
ERROR in ./node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs
Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string 'D:\GitHub\tina\TinaAppV2\node_modules\@nativescript\datetimepicker\angular\fesm2015\nativescript-datetimepicker-angular.mjs: This application depends upon a library published using Angular version 14.0.4, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.
8 | }
9 | DatePickerFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DatePickerFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
> 10 | DatePickerFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: DatePickerFieldDirective, selector: "DatePickerField", ngImport: i0 });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DatePickerFieldDirective, decorators: [{
12 | type: Directive,
13 | args: [{'
at run (D:\GitHub\tina\TinaAppV2\node_modules\@babel\core\lib\transformation\index.js:37:15)
at run.next (<anonymous>)
at Function.transform (D:\GitHub\tina\TinaAppV2\node_modules\@babel\core\lib\transform.js:25:41)
at transform.next (<anonymous>)
at step (D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:261:32)
at D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:273:13
at async.call.result.err.err (D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:223:11)
at D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:37:40
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
@ ./src/app/app.module.ts 4:0-88 24:12-44
@ ./src/main.ts 4:0-45 6:69-78
webpack 5.70.0 compiled with 1 error in 1858 ms
Webpack compilation complete. Watching for file changes.
File change detected. Starting incremental webpack compilation...
assets by status 20.5 MiB [cached] 49 assets
assets by path . 88.5 KiB
asset runtime.js 87.7 KiB [emitted] (name: runtime)
asset runtime.6078891759685e2740ea.hot-update.js 736 bytes [emitted] [immutable] [hmr] (name: runtime)
asset runtime.6078891759685e2740ea.hot-update.json 31 bytes [emitted] [immutable] [hmr]
Entrypoint bundle 19.7 MiB = runtime.js 87.7 KiB runtime.6078891759685e2740ea.hot-update.js 736 bytes vendor.js 17.5 MiB bundle.js 2.18 MiB
cached modules 6.59 MiB [cached] 742 modules
runtime modules 25.2 KiB 13 modules
./node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs 39 bytes [built] [1 error]
ERROR in ./node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs
Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string 'D:\GitHub\tina\TinaAppV2\node_modules\@nativescript\datetimepicker\angular\fesm2015\nativescript-datetimepicker-angular.mjs: This application depends upon a library published using Angular version 14.0.4, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.
8 | }
9 | DatePickerFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DatePickerFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
> 10 | DatePickerFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.4", type: DatePickerFieldDirective, selector: "DatePickerField", ngImport: i0 });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: DatePickerFieldDirective, decorators: [{
12 | type: Directive,
13 | args: [{'
at run (D:\GitHub\tina\TinaAppV2\node_modules\@babel\core\lib\transformation\index.js:37:15)
at run.next (<anonymous>)
at Function.transform (D:\GitHub\tina\TinaAppV2\node_modules\@babel\core\lib\transform.js:25:41)
at transform.next (<anonymous>)
at step (D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:261:32)
at D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:273:13
at async.call.result.err.err (D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:223:11)
at D:\GitHub\tina\TinaAppV2\node_modules\gensync\index.js:37:40
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at processImmediate (node:internal/timers:437:9)
@ ./src/app/app.module.ts 4:0-88 24:12-44
@ ./src/main.ts 4:0-45 6:69-78
So I tried to upgrade angular to 14 as suggested but it gave me more errors that I don't know how to fix them and I know the plugin
is supposed to work with angular 13
ng version

my package.json
{
"name": "TinaAppV2",
"main": "./src/main.ts",
"version": "1.0.0",
"private": true,
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@nativescript/angular": "^13.0.0",
"@nativescript/core": "~8.2.2",
"@nativescript/datetimepicker": "^2.1.9",
"@nativescript/firebase": "^11.1.2",
"@nativescript/geolocation": "^8.0.2",
"@nativescript/theme": "~3.0.2",
"@nstudio/nativescript-checkbox": "^2.0.5",
"@nstudio/nativescript-floatingactionbutton": "^3.0.4",
"@nstudio/nativescript-pulltorefresh": "^3.0.2",
"nativescript-forgm-sound": "^1.1.3",
"nativescript-ui-chart": "^9.0.2",
"nativescript-ui-sidedrawer": "^10.0.2",
"rxjs": "~7.5.0",
"zone.js": "~0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^13.3.6",
"@angular/compiler-cli": "~13.2.0",
"@nativescript/android": "8.2.3",
"@nativescript/ios": "8.2.3",
"@nativescript/types": "~8.2.0",
"@nativescript/webpack": "~5.0.6",
"@ngtools/webpack": "~13.2.0",
"typescript": "~4.5.5"
}
}
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với package được báo cáo tại node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs và các phiên bản Angular trong package.json. Tái hiện quá trình build thông qua src/app/app.module.ts, sau đó xác định liệu plugin có thể build với các dependency Angular 13 đã nêu hay không. Hoàn thành khi lỗi biên dịch webpack được báo cáo đã được khắc phục mà không phát sinh thêm các lỗi nâng cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript
- Lĩnh vực
- build-system, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100