@prefresh/webpack @prefresh/next __webpack_require__(...) is not a function
See original GitHub issue@prefresh/webpack version 3.0.0 does not work with @prefresh/next.
Problem in method “matcher” in class “ReloadPlugin”.
It looks like the constant “nextMatcherOptions” excludes the modules needed for prefresh to work.
if replace in the file “@prefresh\webpack\src\utils”
exports.nextMatcherOptions = {
include: /\.([jt]sx?)$/,
exclude: /node_modules\/(?!next[\\/]dist[\\/]next-server[\\/]lib).*/,
};
with
exports.nextMatcherOptions = {
include: /\.([jt]sx?)$/,
exclude: /node_modules/,
};
everything works fine
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Webpack, require is not a function - node.js - Stack Overflow
It's a static server which will automatically recompile your files using the same webpack config so you can be sure the code you're...
Read more >TypeError: __webpack_require__(...) is not a function #9379
is not a function If the current behavior is a bug, please provide the steps to reproduce. it's a really simple situation that...
Read more >'TypeError: arguments[i].apply is not a function' error when ...
When working with Webpack you might come across the following error: TypeError: arguments[i].apply is not a function. So what are you doing wrong...
Read more >How to Fix Webpack Merge Is Not a Function - Future Studio
This tutorial shows you how to fix the Webpack merge error not being a function. The Problem: Webpack Merge Is Not a Function....
Read more >How to include Node modules with Webpack
Since all Node functions are already provided through the Webpack externals, one does not have to require them. Finally, you import any module ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I guess this is only an issue with latest next since they must’ve changed something that breaks this regex, this regex is intentionally so so that
next/async
andnext/router
would work.Our tests aren’t having this issue, curious about this
Will try this out later today https://github.com/JoviDeCroock/prefresh/pull/262