NativeScript / NativeScript/plugins

Error DateTimePicker in module @nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs

未關閉
#304 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
TypeScript
星號
206
分支
123
平均合併
2 天 1 小時
30 天內合併 PR
1

描述

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

image

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"
  }
}

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 node_modules/@nativescript/datetimepicker/angular/fesm2015/nativescript-datetimepicker-angular.mjs 中回報的 package 以及 package.json 中的 Angular 版本開始。透過 src/app/app.module.ts 重現建置,然後確認該外掛程式是否能使用所述的 Angular 13 相依性進行建置。完成的標準是解決回報的 webpack 編譯錯誤,同時不引入額外的升級錯誤。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, typescript
領域
build-system, mobile-dev
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。