-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
nextjs中使用打包时报错 #239
Comments
要写在 useEffect 里,写在外面是在服务器跑的,所以没 window |
引入的时候就报错了。。。 |
那你可能要搜一下 nextjs 怎么绕过用了 window 对象的库😂 |
To disable pre rendering in a next js project follow the instruction in following link. |
之前的代码
之后的代码
这样写会提示 |
应该是 |
之前的代码
之后的代码
这样修改,npm run dev工作正常,npm run build 和npm run export时也正常.
|
经过测试,在REACT和NEXTJS下面,不会报错,但是无法正常渲染出来界面,所以放弃这种写法,非常感谢群主回复. |
在nextjs中使用打包的时候会报错,尝试 dynamic import动态加载也不行
The text was updated successfully, but these errors were encountered: