How to install module #10284
Unanswered
flamecopper
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I try to install a custom module called 'http', however, it shows as the following, do assist:
Module not found: Error: Can't resolve 'http' in 'xxx/xxx/xxx/xxx/'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
I try to install a custom component on a mdx file:
import '/src/components/dbroute.js'
..................., and it results in the following error:
const http = require('http');
const server = http.createServer((req, res) => {
const url = req.url;
Beta Was this translation helpful? Give feedback.
All reactions