当前位置: 首页 > news >正文

NextJS 项目,编译成功,但是启动失败的解决方案

前言

在刚刚我写的文章 《Next.js V15 在异步页面中,获取路由动态参数的几个坑》 中,我顺利的编译好开发的项目了。于是很开心的去吃个了晚饭,回来后,想启动了看看,在生产模式下是否有什么问题。

非常意外的,出问题了,连刚刚吃下午的小龙虾都不香了。

编译成功后,启动失败的错误信息

报错信息如下:

报错信息演示

为便于搜索引擎抓取,为有同样问题的朋友方便搜索,具体的报错代码如下,看解决方案的朋友跳过。

 next start -p 3010▲ Next.js 15.1.8- Local:        http://localhost:3010- Network:      http://192.168.8.11:3010✓ Starting...✓ Ready in 277ms⨯ Error: Expected to use Webpack bindings (react-server-dom-webpack/server.edge) for React but the current process is referencing 'createClientModuleProxy' from the Turbopack bindings (react-server-dom-turbopack/server.edge). This is likely a bug in our integration of the Next.js server runtime.at [project]/node_modules/.pnpm/next@15.1.8_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.66.0/node_modules/next/dist/client/components/error-boundary.js (client proxy) <module evaluation> (.next/server/chunks/ssr/3fa86_next_dist_c15ec7._.js:15524:9)at instantiateModule (.next/server/chunks/ssr/[turbopack]_runtime.js:590:23)at getOrInstantiateModuleFromParent (.next/server/chunks/ssr/[turbopack]_runtime.js:645:12)at esmImport (.next/server/chunks/ssr/[turbopack]_runtime.js:132:20)at [project]/node_modules/.pnpm/next@15.1.8_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.66.0/node_modules/next/dist/client/components/error-boundary.js [app-rsc] (ecmascript) (.next/server/chunks/ssr/3fa86_next_dist_c15ec7._.js:15539:336)at instantiateModule (.next/server/chunks/ssr/[turbopack]_runtime.js:590:23)at getOrInstantiateModuleFromParent (.next/server/chunks/ssr/[turbopack]_runtime.js:645:12)at esmImport (.next/server/chunks/ssr/[turbopack]_runtime.js:132:20)at [project]/node_modules/.pnpm/next@15.1.8_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.66.0/node_modules/next/dist/esm/build/templates/app-page.js?page=/_not-found/page { METADATA_0 => "[project]/src/app/favicon.ico.mjs { IMAGE => \"[project]/src/app/favicon.ico [app-rsc] (static)\" } [app-rsc] (structured image object, ecmascript, Next.js server component)", MODULE_1 => "[project]/src/app/layout.tsx [app-rsc] (ecmascript, Next.js server component)", MODULE_2 => "[project]/node_modules/.pnpm/next@15.1.8_react-dom@19.1.0_react@19.1.0__react@19.1.0_sass@1.66.0/node_modules/next/dist/client/components/not-found-error.js [app-rsc] (ecmascript, Next.js server component)" } [app-rsc] (ecmascript) <module evaluation> (.next/server/chunks/ssr/_8a4e3e._.js:262:325)

解决方案

见鬼了,把报错代码扔给 DeepSeek,结果这货又开始胡言乱语了:

胡言乱语的 DeepSeek

看来是指不上 DeepSeek 了。搜索引擎开干,终于找到了病友和解决方案。

参考资料地址:https://github.com/vercel/next.js/discussions/61804

根据遇到相同问题的网友的经验,解决这个问题的方案就是—— 重新编译一下!

于是 pnpm run build 走起,再次运行项目:

成功启动
这 TM 都哪儿跟哪儿啊这是!

看来是 NextJS 底层有点什么 BUG 导致的这个问题,导致在编译过程中,有几率发生这样的小故障。如果看官你也遇到了同样的问题,也可以和我一样,重新编译一下。大不了,多编译几下。

还好,项目快收尾了。这个世界,还真是个草台班子~

文章没啥实际内容,纯粹是水了一篇,只为方便遇到同样问题的朋友。所以,点个赞再走吧~

相关文章:

  • Docker镜像存储路径迁移指南(解决磁盘空间不足问题)
  • 嵌入式学习笔记——day27
  • 22 程序控制语句详解:跳转控制(break、continue、goto)、死循环应用、程序控制编程实战
  • 支持单双及四像素模式的testpattern仿真
  • [DS]使用 Python 库中自带的数据集来实现上述 50 个数据分析和数据可视化程序的示例代码
  • 如何用,向量表示3维空间种的有向线段(4,2,3)
  • md650透传
  • Day36打卡 @浙大疏锦行
  • 【RocketMQ 生产者和消费者】- 生产者发送故障延时策略
  • QListWidget的函数,信号介绍
  • 前端垫片chimp
  • idea和cursor快速切换
  • 【八股战神篇】操作系统高频面试题
  • 动态导入与代码分割实战
  • 【时时三省】Python 语言----牛客网刷题笔记
  • Spring | 在Spring中使用@Resource注入List类型的Bean并按优先级排序
  • Windows鼠标掉帧测试与修复
  • vue2项目搭建
  • 计算机视觉应用 Slot Attention
  • JVM 的垃圾回收机制
  • 武汉网站模板建站/专业全网优化
  • 广告公司制作/郑州seo排名第一
  • wordpress vr网站/怎么做蛋糕
  • 网站里的搜索怎么做/广州网络推广外包平台
  • 个人网站能挂广告吗/做博客的seo技巧
  • 贵州建网站/全球网站访问量排名