仅限 Edge 上的 Angular 网站问题:SCRIPT5022 预期标识符字符串或数字 [英] Problem with Angular website on Edge only: SCRIPT5022 expected identifier string or number
问题描述
我们刚刚推出了我们的网站,但我在 Edge 上遇到了问题.我不知道错误来自哪里,我确保任何脚本中都没有休息语法.
We just launched our website but I'm facing a problem on Edge. I can't figure out where the error is coming from, I made sure there is no rest syntax in any script.
这是我们的网站:https://bubblydoo.be/nl
如果您有关于网站的其他反馈,您绝对可以告诉我!
If you have other feedback regarding the website, you can definitely let me know!
推荐答案
问题是一些模块,包括 picomatch,没有转译为 ES5,而 webpack 也不转译任何 node_modules,它只是按原样接受它们.Picomatch 包含在 Rollup 捆绑的内部库中,因此我使用 babel (rollup-plugin-babel
) 对其进行转译:
The problem was that some modules, including picomatch, were not transpiled to ES5, and webpack doesn't transpile any node_modules, it just takes them as is. Picomatch was included by an internal library that was bundled by Rollup, so I used babel (rollup-plugin-babel
) to transpile it:
babel({
exclude: /node_modules\/(?!picomatch)/,
})
这篇关于仅限 Edge 上的 Angular 网站问题:SCRIPT5022 预期标识符字符串或数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!