Next >14.0.1 cannot use @ant-design/icons (unexpected token 'export') #65707
Labels
bug
Issue was opened via the bug report template.
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
Developer Experience
Issues related to Next.js logs, Error overlay, etc.
Module Resolution
Module resolution (CJS / ESM, module resolving)
Webpack
Related to Webpack with Next.js.
Link to the code that reproduces this issue
https://github.com/BaileyMillerSSI/next-ant-design-demo
To Reproduce
npx create-next-app@latest
(I selected typescript, tailwind, src dir (pages), and other defaults)npm install @ant-design/icons
index.tsx
file to include an ant design iconCurrent vs. Expected behavior
Displayed error:
In an existing project I was previously on Next 14.0.1 and upgraded to 14.1.1 to resolve the published security issue. After upgrading I was unable to use ant-design/icons. This is demo is in a fresh application.
Expected:
@ant-design/icons would be usable within the base project. I have tried changing the
package.json
to be type: module and that has no affect. It seems that either or both of these are true; something was broken in next during the upgrade to >14.0.1 or ant-design/icons had a bug hidden in it that upgrading next to >14.0.1 exposed as a build error.Provide environment information
Which area(s) are affected? (Select all that apply)
create-next-app, Developer Experience, Module Resolution, Webpack
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
As far I can tell this appears to be an issue with @ant-design/icons BUT next didn't complain about it until >14.0.1. With teams upgrading to resolve the security issue fixed in next 14.1.1 I suspect that more users will run into this issue.
Re:
ant-design/ant-design-icons#619
ant-design/ant-design-icons#605
The text was updated successfully, but these errors were encountered: