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 摘要。