尝试让我的angular 7应用程序在chromium v41 (WSR)上运行。在较新的浏览器上,一切都运行得很好,但是Chrome41抛出了一个异常:“未捕获的SyntaxError:意想不到的令牌=>”
...
onComplete: (self) => {},
...我的polyfills.ts:
/** IE9, IE10, IE11, and Chrome <55 requires all of the following polyfills.
* This also includes Android Emulators with older versions of Chrome and Google Search/Googlebot
*/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es7/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es7/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
...tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}我是不是遗漏了什么让它在铬41上工作的东西?
发布于 2019-05-06 21:27:54
好了,找到这个原因的根源了。
我一直在使用typed.js,但导入了错误的文件来使用。
基本上有
import Typed from 'typed.js/src/typed.js';可能是自动导入的。
更改为
import Typed from 'typed.js';它又开始工作了!
https://stackoverflow.com/questions/56001504
复制相似问题