Internet Explorer says 'Invalid character in vendor.js' ( ` )

杀马特。学长 韩版系。学妹 提交于 2021-02-11 14:39:40

问题


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

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

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

solved

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.


回答1:


It looks like back-ticks are used at that line and IE11 doesn't support it. To make it work you will have to transpile your code with Babel.




回答2:


It's because you must have used ` template string (button below the Esc), IE 11 does not support it. You should have to use " or ' for your strings

More info

https://caniuse.com/#search=string




回答3:


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.

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



来源:https://stackoverflow.com/questions/57425517/internet-explorer-says-invalid-character-in-vendor-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!