【发布时间】:2021-01-25 20:03:10
【问题描述】:
我在预构建时遇到以下错误。
× ERROR Template execution failed: Error: The XMLHttpRequest compatibility library was not found.
然而,preact 开发模式在相同的代码库下运行良好。我正在使用带有默认模板的 preact-cli。 有什么想法吗?
编辑:似乎 firebase 可能会导致它。不知道为什么。任何帮助表示赞赏。
Build [=================== ] 93% (14.4s) after chunk asset optimization[2021-01-25T20:12:57.501Z] @firebase/app:
Warning: This is a browser-targeted Firebase bundle but it appears it is being
run in a Node environment. If running in a Node environment, make sure you
are using the bundle specified by the "main" field in package.json.
If you are using Webpack, you can specify "main" as the first item in
"resolve.mainFields":
https://webpack.js.org/configuration/resolve/#resolvemainfields
【问题讨论】:
标签: javascript preact