简体   繁体   中英

Preact build Template execution failed: Error: The XMLHttpRequest compatibility library was not found

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文简体   中文繁体   中英对照 版本,有任何建议请联系yoyou2525@163.com。

I am facing below error on preact build.

× ERROR Template execution failed: Error: The XMLHttpRequest compatibility library was not found.

however, preact dev mode is working fine with same codebase. I am using preact-cli with default template. Any ideas?

Edit: It seems like firebase might be causing it. Not sure why. Any help is appreciated.

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
1 anwsers

Preact 团队回答 - 使用 --no-prerender 标志构建,因为默认情况下 Preact 使用 prerender 构建并且需要节点 env。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question
 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM