Closed
Description
What version of Next.js are you using?
12
What version of Node.js are you using?
16
What browser are you using?
chrome
What operating system are you using?
macOS
How are you deploying your application?
vercel/netlify
Describe the Bug
Nullish operator breaks pages, for example
const test = my_array?.[0] ?? [];
will produce
(my_array === null || my_array === void 0 ? void 0 : my_array[0]) ?? [];
Expected Behavior
It should replace with ||
or what webpack / swc think is better
To Reproduce
Some api with
const test = my_array?.[0] ?? '';
next.config.js
experimental: {
concurrentFeatures: false,
serverComponents: false,
swcMinify: false
}
next build