首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Chrome41上的Angular 7:未捕获的SyntaxError:意外的标记=>

Chrome41上的Angular 7:未捕获的SyntaxError:意外的标记=>
EN

Stack Overflow用户
提问于 2019-05-06 16:32:59
回答 1查看 528关注 0票数 1

尝试让我的angular 7应用程序在chromium v41 (WSR)上运行。在较新的浏览器上,一切都运行得很好,但是Chrome41抛出了一个异常:“未捕获的SyntaxError:意想不到的令牌=>”

代码语言:javascript
复制
...
onComplete: (self) => {},
...

我的polyfills.ts:

代码语言:javascript
复制
/** 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

代码语言:javascript
复制
{
  "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上工作的东西?

也发表在问题上:https://github.com/angular/angular/issues/30279

EN

回答 1

Stack Overflow用户

发布于 2019-05-06 21:27:54

好了,找到这个原因的根源了。

我一直在使用typed.js,但导入了错误的文件来使用。

基本上有

代码语言:javascript
复制
import Typed from 'typed.js/src/typed.js';

可能是自动导入的。

更改为

代码语言:javascript
复制
import Typed from 'typed.js';

它又开始工作了!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56001504

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档