Closed evanlong0803 closed 8 months ago
没事了,这是 Nextjs
框架的问题
没事了,这是
Nextjs
框架的问题
什么问题导致的,怎么解决,今天配置热更新遇到了
没事了,这是
Nextjs
框架的问题
我也遇到了。楼主怎么解决的
按照 https://github.com/auth0/node-auth0/issues/798 这个
pkg文件增加配置 resolve: { alias: { "superagent": "6.0.0" } } } 使用yarn 安装 解决了, 不知道后续会不会有什么副作用
按照 auth0/node-auth0#798 这个
pkg文件增加配置 resolve: { alias: { "superagent": "6.0.0" } } } 使用yarn 安装 解决了, 不知道后续会不会有什么副作用
大概率是包导出时写法的问题,包中可能使用了一个表达式。而在某些框架中对表达式不是很敏感
我从nextjs13升级到14版本后,也报了这个异常
我的解决办法是:
next.config.mjs
配置中,添加 webpack 在 server 模式下的别名
/** @type {import('next').NextConfig} */
const nextConfig = {
...,
webpack: (config, { isServer }) => {
if (isServer) {
return {
...config,
resolve: {
...config.resolve,
alias: { ...config.resolve.alias, hexoid: "hexoid/dist/index.js" },
},
// 引入微信支付相关包后,警告【Critical dependency: the request of a dependency is an expression】关闭
module: { ...config.module, exprContextCritical: false },
};
}
return config;
},
};
export default nextConfig;
Thank you @hevi1991 ! Your suggestion helped me to fix this error in my Nextjs v14 project.
这是为什么?