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

Error: Can't resolve 'net' in ... #3

Open
williamli opened this issue Aug 15, 2018 · 4 comments
Open

Error: Can't resolve 'net' in ... #3

williamli opened this issue Aug 15, 2018 · 4 comments

Comments

@williamli
Copy link

import "node-window-polyfill/register"; was inserted into the code and I get a Can't resolve 'net'

ModuleNotFoundError: Module not found: Error: Can't resolve 'net' in '/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/ws/lib'
    at factoryCallback (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/webpack/lib/Compilation.js:276:40)
    at factory (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/webpack/lib/NormalModuleFactory.js:235:20)
    at resolver (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/webpack/lib/NormalModuleFactory.js:60:20)
    at asyncLib.parallel (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/webpack/lib/NormalModuleFactory.js:127:20)
    at /Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/async/dist/async.js:3888:9
    at /Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/async/dist/async.js:1062:13)
    at /Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/async/dist/async.js:969:16
    at /Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/async/dist/async.js:3885:13
    at resolvers.normal.resolve (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/webpack/lib/NormalModuleFactory.js:119:22)
    at onError (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/enhanced-resolve/lib/Resolver.js:65:10)
    at loggingCallbackWrapper (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at runAfter (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
    at innerCallback (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
    at loggingCallbackWrapper (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at next (/Users/williamli/projects/bbiHQ/exchangeunion-frontend/node_modules/tapable/lib/Tapable.js:252:11)
@tgorka
Copy link
Owner

tgorka commented Aug 18, 2018

@williamli Is it all stack trace? Do you have a gist with the code to identify the problem? It's hard to see the problem with this setup for me right now.
Btw. are you using it in the frontend?

@painedpineapple
Copy link

I'm also getting this error. Looks like an issue with the ws dependency?

ERROR in ./node_modules/ws/lib/websocket.js
Module not found: Error: Can't resolve 'net' in '/home/user/universal/node_modules/ws/lib'
 @ ./node_modules/ws/lib/websocket.js 7:12-26
 @ ./node_modules/ws/index.js
 @ ./node_modules/node-window-polyfill/index.js
 @ ./node_modules/node-window-polyfill/register.js
 @ ./src/index.tsx

ERROR in ./node_modules/ws/lib/websocket.js
Module not found: Error: Can't resolve 'tls' in '/home/user/universal/node_modules/ws/lib'
 @ ./node_modules/ws/lib/websocket.js 8:12-26
 @ ./node_modules/ws/index.js
 @ ./node_modules/node-window-polyfill/index.js
 @ ./node_modules/node-window-polyfill/register.js
 @ ./src/index.tsx

@NHuebner1983
Copy link

Hi! I was hoping this would have something figured out. Anyone know how to fix this? using register(false) and register(true) have the same error.

I am going to look into figuring it out because I'm running out of options, and this was my last hope - needing it for a nativescript-vue app that has dependencies trying to use the window object (third party vendors).

I will post my updates soon if it helps anyone.

@tgorka
Copy link
Owner

tgorka commented Mar 6, 2021

I updated the libraries. That might help. If anyone will have this issue please get reach me out (page in my profile) for a fast solving issue.

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