Internet Explorer 显示“vendor.js 中的字符无效"(`) [英] Internet Explorer says 'Invalid character in vendor.js' ( ` )

查看:37
本文介绍了Internet Explorer 显示“vendor.js 中的字符无效"(`)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular 7 应用程序无法在 Internet Explorer 上运行.它说 vendor.js 中的字符无效

Angular 7 application not working on internet explorer. It says invalid character in vendor.js

我已经应用了 polyfills.ts 更改,但它仍然无法正常工作.

I have already apply polyfills.ts changes but it still not working.

我的 tsconfig.json =>

my 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"
    ]
  }
}

已解决

我发现了一个包含反引号的模块identicons",并将其从项目中删除,问题解决了.谢谢大家的帮助.

I found a module 'identicons' which containing back-ticks and removed it from the project and the problem solved. Thank you all for your helps guys.

推荐答案

你的打字稿有目标 es5,所以你自己的源代码没有问题,因为它会转换为正常引号.

You have as target es5 for your typescript, so there is nothing wrong inside your own source code, because it will transpile to normal quotes.

错误也来自 vendor.js.这意味着您正在使用不支持 IE11 的自定义库.可能浏览错误所在的 vendor.js 会给你一个线索是哪个库导致它

Also the errors comes from vendor.js. This means that you are using a custom library which does not support IE11. Probably browsing the vendor.js where the error resides will give you a clue which library is causing it

这篇关于Internet Explorer 显示“vendor.js 中的字符无效"(`)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆