Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve 'http'? #34

Open
spyhunter99 opened this issue Nov 25, 2023 · 3 comments
Open

Can't resolve 'http'? #34

spyhunter99 opened this issue Nov 25, 2023 · 3 comments

Comments

@spyhunter99
Copy link

First of all, awesome library. i hope i can get it working.... I'm talking through the tutorial from https://github.com/Paciolan/remote-component, refresh react projects. I was able to get a react component to compile but was unable to get it to load in the main app. I then tried to load the tutorial's plugin via github. (kind of new to react/nodejs stuff so bare with me)...

Anyhow, this is the error i'm getting.

Module not found: Error: Can't resolve 'http' in 'myapp\node_modules\@paciolan\remote-module-loader\dist\lib'
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 did try npm i stream-http http https but that didn't fix anything. Trying to understand the error message...is this a webpack versioning issue?

@leejunhui
Copy link

I also encountered this issue, @spyhunter99 did you figure out a workaround?

@see2ever
Copy link

webpack.config.js

resolve: {
      fallback: {
        http: false,
        https: false,
      },
    },

@huy-lv
Copy link

huy-lv commented May 25, 2024

how to fix this without webpack.config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants