Invalid left-hand side in assignment #29629
-
What version of Next.js are you using?11.1.2 What version of Node.js are you using?12.22.1 What browser are you using?Chrome What operating system are you using?MacOS How are you deploying your application?Other platform Describe the BugWhen packaging up my application for serverless deployment the following code: https://github.com/vercel/next.js/blob/canary/packages/next/server/next-server.ts#L295 gets packaged up to: true = JSON.stringify(true); which results in the following exception at runtime:
Expected BehaviorNo exception To ReproduceI am deploying my app using: A simple API route that returns 200 OK results in this error. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
isn't |
Beta Was this translation helpful? Give feedback.
-
Hi, this sounds like a bug in how the bundling in |
Beta Was this translation helpful? Give feedback.
-
right, after a tortuous path I finally found the culprit. We use Sentry and deep in their docs it says that the webpack configuration is not compatible with serverless environments: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/. This can be closed. |
Beta Was this translation helpful? Give feedback.
-
after few hour of investigation, remove the config will start your middleware.. // next.config.js
webpack: (config, { buildId }) => {
config.plugins.push(
new webpack.DefinePlugin({
'process.env': {
BUILD_ID: JSON.stringify(buildId),
},
})
)
return config
}, |
Beta Was this translation helpful? Give feedback.
right, after a tortuous path I finally found the culprit. We use Sentry and deep in their docs it says that the webpack configuration is not compatible with serverless environments: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/. This can be closed.