-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Closed
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.
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
Metadata
Metadata
Assignees
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.