NativeScript / NativeScript/plugins
Error DateTimePicker in module @nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 206
- Forks
- 123
- Merge moyen
- 2 j 1 h
- PR mergées (30 j)
- 1
Description
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"
}
}
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le package signalé dans node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs et par les versions d’Angular dans package.json. Reproduisez le build via src/app/app.module.ts, puis déterminez si le plugin peut être compilé avec les dépendances Angular 13 indiquées. C’est terminé lorsque l’erreur de compilation webpack signalée est résolue sans introduire d’erreurs de mise à niveau supplémentaires.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- build-system, mobile-dev
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100