-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.0.0 版本 export 'theme' (imported as 'antdTheme') was not found in 'antd' #5762
Comments
我也碰到了这个问题 |
应该是发错版本了,v2 得搭配 antdv5 使用 |
一样的问题 |
这个没办法去掉,可以先忽略, |
我也遇到了,导致 umi/max 项目升级,在vite模式下,直接崩溃了 |
大佬,项目用的是 vite 的话不仅仅是警告,项目启动和 build 都报错了 |
报error可能是因为设置了strictExportPresence:true, webpack的可以使用如下配置。 ignoreWarnings: [
/export 'theme' \(imported as 'antdTheme'\) was not found in 'antd'/
], |
如果是vite,可以自定义个插件 optimizeDeps: {
esbuildOptions: {
plugins: [
{
name: "add-missing-theme",
setup(build) {
build.onLoad({ filter: /antd(?:\/|\\{1,2})es(?:\/|\\{1,2})index\.js/ }, async(args) => {
let text = await fs.promises.readFile(args.path, 'utf8')
return {
contents: `
${text}\nexport const theme = undefined;
`,
loader: "js",
};
});
},
},
],
}
}, |
这样配置 了编译不报错,但是 运行时还是会报于这相关的错误信息 |
@hqwlkj 这个问题我发现是由于 SWR 的版本问题。使用 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🧐 问题描述
依赖:
Index.js
启动后控制台信息:
The text was updated successfully, but these errors were encountered: