rsnext/errors/css-modules-npm.md
Tim Neutkens 08bb2698f5
Update error doc for CSS Modules in third-party deps (#46121)
Fixes NEXT-355



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-19 13:39:13 +00:00

919 B

CSS Modules Imported by a Dependency

Why This Error Occurred

One of your dependencies (node_modules) imports a CSS Modules file.

This normally happens when a package's source files are accidentally consumed, instead of the built package.

Possible Ways to Fix It

Reach out to the maintainer and ask for them to publish a compiled version of their dependency.

Compiled dependencies do not have references to CSS Module files, or any other files that require bundler-specific integrations.

The dependency should also provide instructions about what CSS needs to be imported by you, in your application.


If this is first party code, try including monorepo packages in the compilation pipeline.


This limitation does not exist when using the app directory: beta.nextjs.org/docs.