question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

transpile Package SCSS/CSS Modules

See original GitHub issue

Describe the feature you’d like to request

to transpile scss modules in a monorepo you still have to use https://www.npmjs.com/package/next-transpile-modules

But the documentation indicates that the package is replaced

Describe the solution you’d like

Add support for scss transpile to the transpilePackage functionality https://beta.nextjs.org/docs/api-reference/next.config.js#transpilepackages

Describe alternatives you’ve considered

update the docs that you still need next-transpile-modules for scss files

To use the appDir function it is required to remove next-transpile-modules

This results in this error

../../packages/ui/components/authSidebar/authSidebar.module.scss
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> .root {
|     --placeholder-style: 1;
| }

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:14
  • Comments:6

github_iconTop GitHub Comments

3reactions
korsvanlooncommented, Oct 27, 2022

I tried both with css and scss and I can confirm both are not working for me either.

experimental: {
    appDir: true,
    transpilePackages: ['@acme/ui'],
  },

packages/ui/build/Carousel.js

...
import styles from './Carousel.module.css';
...
error - ../../packages/ui/build/Carousel.module.css
Module parse failed: Unexpected token (8:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| /*  GLOW */
| /*  RADIUS */
> .embla {
|   position: relative;
| }
0reactions
github-actions[bot]commented, Dec 1, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use Sass with CSS Modules in Next.js - freeCodeCamp
Step 1: Installing Sass in a Next.js app ... While Next.js comes with some good built-in CSS support, it doesn't come with Sass...
Read more >
How to configure SCSS modules for Webpack
SCSS modules are a fantastic way of writing clean, self contained styles, that are usually consumed by components.
Read more >
sass-loader - webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
How to transpile scss with Babel for a react package?
As far as I know, yes. You need more than just Babel if you want to deal with SCSS. The reason is that...
Read more >
esbuild-sass-plugin - npm
esbuild plugin for sass/scss files supporting both css loader and css result import (lit-element). Latest version: 2.4.4, last published: 3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found