尝试在渲染上构建部署我的 Vite react 应用程序并收到此错误。我认为它与 Yup 模块有关,但它已安装

Trying to build deploy my Vite react app on render and getting this error. I figured it has something to do with the Yup module but it is installed

提问人:user22867449 提问时间:11/6/2023 更新时间:11/6/2023 访问量:45

问:

[vite]:汇总无法解析从“/opt/render/project/src/src/pages/Login.jsx”导入“Yup”。 这很可能是无意的,因为它可能会在运行时破坏您的应用程序。 如果确实要显式外部化此模块,请在生成期间将其添加到错误中: 错误:[vite]:汇总无法解析从“/opt/render/project/src/src/pages/Login.jsx”导入“Yup”。 这很可能是无意的,因为它可能会在运行时破坏您的应用程序。 11 月 6 日下午 02:44:13 如果您确实想显式外部化此模块,请将其添加到 11 月 6 日下午 02:44:13 at viteWarn (file:///opt/render/project/src/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:48205:27) 11 月 6 日下午 02:44:13 at onwarn (file:///opt/render/project/src/node_modules/@vitejs/plugin-react/dist/index.mjs:247:9) 11 月 6 日下午 02:44:13 在 onRollupWarning (file:///opt/render/project/src/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:48234:9) 11 月 6 日下午 02:44:13 在 onwarn (file:///opt/render/project/src/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:47965:13) 11 月 6 日下午 02:44:13 在 file:///opt/render/project/src/node_modules/rollup/dist/es/shared/node-entry.js:24276:13 11 月 6 日下午 02:44:13 在 Object.logger [as onLog] (file:///opt/render/project/src/node_modules/rollup/dist/es/shared/node-entry.js:25950:9) 11 月 6 日下午 02:44:13 在 ModuleLoader.handleInvalidResolvedId (file:///opt/render/project/src/node_modules/rollup/dist/es/shared/node-entry.js:24862:26) 11 月 6 日下午 02:44:13 在 file:///opt/render/project/src/node_modules/rollup/dist/es/shared/node-entry.js:24822:26 11 月 6 日下午 02:44:13 at processTicksAndRejections (internal/process/task_queues.js:95:5) 11 月 6 日下午 02:44:13 npm ERR!代码 ELIFECYCLE 11 月 6 日下午 02:44:13 npm ERR!错误编号 1 11 月 6 日下午 02:44:13 npm ERR![email protected] 构建:11 月 6 日下午 02:44:13 npm ERR!退出状态 1 11 月 6 日下午 02:44:13 npm ERR!build.rollupOptions.externalbuild.rollupOptions.externalvite build

我尝试在本地构建应用程序,它奏效了。我什至能够使用“Vite 预览”在我的本地主机上预览它,但是在渲染上部署时它总是无法构建

JavaScript ReactJS 渲染 生产

评论

0赞 AztecCodes 11/6/2023
请改进您的问题。不清楚你在问什么。
0赞 Community 11/6/2023
请修剪您的代码,以便更轻松地找到您的问题。请遵循以下准则,创建一个最小的可重现示例

答: 暂无答案