Cannot add property 0, object is not extensible

nuxt3构建本地没问题线上突然报错,本地用的pnpm锁了rollup版本,服务器用的npm没锁,在rollup更新4.41.0 -> 4.45.0时报错

> nuxt-app@ build D:\Projects\Company\spellai-nuxt
> nuxt build

Nuxt 3.17.1 with Nitro 2.11.13                                                                                                                                             nuxi 15:59:17  

 WARN  You have disallowed robots accessing /_nuxt/**, this may prevent your site from being indexed correctly.                                                    @nuxt/robots 15:59:20  

ℹ Building for Nitro preset: node-server                                                                                                                                  nuxi 15:59:20   
ℹ Building client...                                                                                                                                                           15:59:21   
ℹ vite v6.3.5 building for production...                                                                                                                                       15:59:21   
ℹ ✓ 2510 modules transformed.                                                                                                                                                  15:59:32   

 ERROR  ✗ Build failed in 10.78s                                                                                                                                                15:59:32  


 ERROR  Nuxt Build Error: Cannot add property 0, object is not extensible                                                                                                  nuxi 15:59:32  

    at Array.push (<anonymous>)
    at ConditionalExpression.getLiteralValueAtPath (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:12270:45)
    at /D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:5064:30
    at EntityPathTracker.withTrackedEntityAtPath (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:2014:24)
    at LocalVariable.getLiteralValueAtPath (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:5062:33)
    at Identifier.getLiteralValueAtPath (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:5207:48)
    at BinaryExpression.getLiteralValueAtPath (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:11785:37)
    at IfStatement.getTestValue (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:12806:77)
    at IfStatement.hasEffects (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:12722:32)
    at IfStatement.shouldBeIncluded (/D:/Projects/Company/spellai-nuxt/node_modules/.pnpm/rollup@4.45.0/node_modules/rollup/dist/es/shared/node-entry.js:2928:62)

 ELIFECYCLE  Command failed with exit code 1.

 解决办法
npm锁定rollup版本

"devDependencies": { "rollup": "4.41.0" }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学途路漫漫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值