-
Notifications
You must be signed in to change notification settings - Fork 30
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
🐛 [BUG] Error when used with Next.js #233
Comments
Currently facing a similar problem with NextJS even when I update the config file to use less-loader.
|
For anyone having this issue here are the steps I used to resolve it for NextJS 14.2.3
Note: Use require and module.exports instead of import and export default if your next.config file has the extension .js (ie not an ES module)
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/@antv/larkmap/es/components/ContextMenu/index.js
Note: use require and module.exports if your config file is next.config.js
This issue arises because LarkMap is a client component and cannot be server-side rendered. To solve this issue, you have to dynamically import the LarkMap component at runtime.
Thats it! The map should now show with no errors. |
🐛 Bug description [Please make everyone to understand it]
📷 Step to reproduce
next.config.js
Error message reported by Next.js
🏞 Expected result
🚑 Any additional [like screenshots]
The text was updated successfully, but these errors were encountered: