next 14.0.4 build error because of antd component
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
hello everyone. i'm using next 14.0.4 app directory and ui library antd somewhere. the runtime doesn't declared directly anywhere in the app (all by defaults). when i try to build the app i get this (screenshot). please can someone explain how do i fix it?
7 Replies
@Barbary Lion hello everyone. i'm using next 14.0.4 app directory and ui library antd somewhere. the runtime doesn't declared directly anywhere in the app (all by defaults). when i try to build the app i get this (screenshot). please can someone explain how do i fix it?
try add those package in the log to
optimizePackageImports in next.config.js experimental: {
optimizePackageImports: ['antd'],
}, @Ray try add those package in the log to `optimizePackageImports` in next.config.js
ts
experimental: {
optimizePackageImports: ['antd'],
},
Barbary LionOP
unfortunately it didn't help
@Barbary Lion unfortunately it didn't help
have you added all of those package name to the list?
@Ray have you added all of those package name to the list?
Barbary LionOP
yes, i have
@Barbary Lion yes, i have
I can build fine with antd. can you share the repo?
@Ray I can build fine with antd. can you share the repo?
Barbary LionOP
sorry, i can't do it because it's my work project. i've also tried to build antd on pure app and it works fine. very strange🥲