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.

@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.

image

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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JoviDeCroockcommented, Jan 23, 2021

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 and next/router would work.

Our tests aren’t having this issue, curious about this

0reactions
JoviDeCroockcommented, Jan 28, 2021
Read more comments on GitHub >

github_iconTop 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 >

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