小编Eva*_* ps的帖子

将 Moment 与 Angular 库 13 一起使用会导致错误

当我在角度库中使用 moment.js (最新版本)时,我面临以下问题:

vendor.js:sourcemap:106713 错误 TypeError: (moment__WEBPACK_IMPORTED_MODULE_2___namespace_cache || (中间值)(中间值)) 不是函数。例如,当我在浏览器中调试 moment().year() 时,它可以工作。

任何人都可以知道这个错误的原因是什么?也许是 EcmaScript 版本。

我将不胜感激任何帮助。

> "compilerOptions": {
>     "declaration": false,
>     "downlevelIteration": true,
>     "experimentalDecorators": true,
>     "lib": [ "es6", "dom" ],
>     "mapRoot": "./",
>     "module": "esnext",
>     "skipLibCheck": true,
>     "moduleResolution": "node",
>     "outDir": "../dist/out-tsc",
>     "sourceMap": true,
>     "target": "ES2015",
>     "typeRoots": [
>       "../node_modules/@types"
>     ],
Run Code Online (Sandbox Code Playgroud)

upgrade typescript angular

5
推荐指数
2
解决办法
8069
查看次数

标签 统计

angular ×1

typescript ×1

upgrade ×1