Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Avoid NextJS module import error #575

Open
MikeWillisFC opened this issue Oct 13, 2021 · 0 comments
Open

Avoid NextJS module import error #575

MikeWillisFC opened this issue Oct 13, 2021 · 0 comments

Comments

@MikeWillisFC
Copy link

This issue is a:

  • Question / support request

nwb v0.25.2
node v14.17.0
npm v6.14.13
react v17.0.2

I'm using nwb to build a React component that I've uploaded to a private github repo. I've included the component on regular React projects with no problem. However, NextJS is giving me an error because I'm using CSS modules in the component:

https://nextjs.org/docs/messages/css-modules-npm

NextJS seems to think that I'm using the source files rather than the built ones, but that's not correct - the folder for the component in my /node_modules/ folder contains the /lib/ folder with the built files (but they are using module imports).

How can I build the component in a way that satisfies NextJS?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant