Coder Social home page Coder Social logo

create-next-app (canary): Import of *.module.scss in Client Component causes `__webpack_require__.n is not a function` crash about next.js HOT 5 CLOSED

karlhorky avatar karlhorky commented on August 22, 2024
create-next-app (canary): Import of *.module.scss in Client Component causes `__webpack_require__.n is not a function` crash

from next.js.

Comments (5)

eps1lon avatar eps1lon commented on August 22, 2024 2

Glad to hear. Thank you for confirming!

from next.js.

eps1lon avatar eps1lon commented on August 22, 2024 1

Workaround proposed in #67673

from next.js.

karlhorky avatar karlhorky commented on August 22, 2024

Workaround

In speaking with @eps1lon, it appears that versions other than [email protected] and [email protected] should not be used, since they will cause production problems, whereas this is just a development problem.

Upgrade to [email protected] and [email protected] versions when using latest canary [email protected]

I retrieved these versions from the App Router reproduction template:

- https://github.com/vercel/next.js/blob/canary/examples/reproduction-template/package.json#L10-L11

from next.js.

karlhorky avatar karlhorky commented on August 22, 2024

Opened a PR to downgrade the App Router reproduction template to [email protected] and [email protected] (even though this causes this problem reported above) because apparently non-19.0.0-rc.0 versions have production problems:

from next.js.

karlhorky avatar karlhorky commented on August 22, 2024

@eps1lon thanks for the PR #67673, merge and publish in [email protected] 🎉

I've confirmed that this resolves the issue in my reproduction:

pnpm dev

> @ dev /Users/k/p/repro-next-js-v15-react-rc-0-sass-webpack-require-not-a-function
> next dev

  ▲ Next.js 15.0.0-canary.77
  - Local:        http://localhost:3000

 ✓ Starting...
 ✓ Ready in 3s
 ○ Compiling / ...
 ✓ Compiled / in 2.7s (482 modules)
 GET / 200 in 2884ms
 ✓ Compiled /favicon.ico in 176ms (275 modules)
 GET /favicon.ico 200 in 273ms
 ○ Compiling /non-home ...
 ✓ Compiled /non-home in 831ms (546 modules)
 GET /non-home 200 in 426ms
 GET /non-home 200 in 921ms
 GET /non-home 200 in 18ms
 GET / 200 in 80ms
 GET /favicon.ico 200 in 21ms
 GET /non-home 200 in 7ms

Here's the diff in the branch:

from next.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.