繁体   English   中英

Cloudflare 页面上的 Vite 构建失败

[英]Vite build failed on cloudflare pages

我正在尝试在 cloudflare 页面上部署我的 vite+react 应用程序,它显示

(node:1365) ExperimentalWarning: The ESM module loader is experimental.
file:///opt/buildhome/repo/node_modules/vite/bin/vite.js:7
    await import('source-map-support').then((r) => r.default.install())
    ^^^^^
SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
    at async link (internal/modules/esm/module_job.js:37:21)

Cloudflare 页面使用不支持此语法的旧版本节点 js。

您可以通过在构建设置中设置 NODE_VERSION 环境变量来更改它。

有关受支持版本的更多详细信息,请参阅: https://developers.cloudflare.com/pages/platform/build-configuration#language-support-and-tools

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM