当我在角度库中使用 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)