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.

Incompatible with latest version of Next.js

See original GitHub issue

When using the latest version of next, the following error is thrown:

./pages/index.22C1ZZc.css:4:0
Module not found:
  Can't resolve '[...]/node_modules/next/dist/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js'
null

Here’s a basic reproduction reproduction repository: TxHawks/style9-latest-next-repro The 1st commit is a working example using Next v10.0.9 The 2nd commit breaks after an upgrade to latest Next (v10.2.3) The 3rd commit remains broken after upgrading next-transpile-modules to its latest version (v7.2.0)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
TxHawkscommented, Jun 1, 2021

Created a pull request in next that fixes it.

Let’s see what they say

0reactions
johanholmerincommented, May 28, 2021

The plugin uses the Webpack loader and plugin bundled with Next.js. getClientStyleLoader returns the path to the loader and some options, which are stringified and are used to prefix the .css import path as instructions for Webpack. It has different loaders for development and production, but we only use the production one. In addition to the loader, the MiniCssExtractPlugin from Next.js is also added. Next.js bundles it’s plugins, and the error is that hotModuleReplacement.js is not included. It’s possible that adding the file back is not enough, that some other changes will cause an issue, but it’s a good place to start. An alternative would be to stop using the bundled css handling and include the MiniCssExtractPlugin directly, although that might cause other issues. The plugin should at least be compatible with Next.js 9.x and 10.x.

You could ask in the Next.js repo and see if anyone there could offer any assistance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade Guide - Next.js
Upgrade React version to latest​​ Most applications already use the latest version of React, with Next. js 11 the minimum React version has...
Read more >
Incompatible with next.js 12.2.0: "Invalid next.config.js ... - GitHub
When compiling with next.js 12.2.0, this warning is shown, even when an empty array is passed for the plugins parameter: warn - Invalid ......
Read more >
Create-next-app fails nvm node 16 doesn't work - Stack Overflow
Trying to create a new next app with yarn create next-app . It fails with this error: error @eslint/eslintrc@1.0.5: The engine "node" is...
Read more >
NextJS or Node Compatability Error - Cloudflare Community
I'm attempting to launch a pages application using NextJS from a git ... I have the latest version of each installed and am...
Read more >
Error deploy next 12.1.5 - Netlify Support Forums
The build image you are using is running an outdated and incompatible version of Node.js. Using one of the methods outlined in the...
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