Property '__webpack_require__' doesn't exist

See original GitHub issue

Hey all, I’ve been using this with our React-Native app, and it works great on iOS. But on Android, it has trouble importing, throwing ReferenceError: Property '__webpack_require__' doesn't exist while trying import anything from @giantmachines/redux-websocket. It appears to be coming from within dist/index.js on line 21:

modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

We don’t use webpack anywhere else in our app, so I was suspecting that the problem could have arose from either that, or something to do with the Metro bundler, since on Android everything runs fine while attached to the chrome debugger. Also I’m aware that this library wasn’t necessarily made for React Native, but thought I’d raise this issue in case it was a more widespread problem with using different packagers or something like that.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chenghwcommented, May 22, 2020

Hi @MichaelDanielTom , thanks for opening this issue. We can look into this. I think I may know what could be going wrong and it’d be tied with how we are building our library. In order to test this assumption, can you upload an example repository which would produce this error? I’ll clone/fork your example and try fixing it locally.

0reactions
wolftech-appcommented, Apr 10, 2022

Alexlee500 is right, the build process is the problem in this case. For example if webpack replaced with rollup, then this problem has gone.

This package only implements just that: https://www.npmjs.com/package/@wolftech.app/redux-websocket

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack - Property context does not exist on type NodeRequire
Solution from 2018: Just install the typings for webpack-env npm i @types/webpack-env -D.
Read more >
Plugins - webpack
A webpack plugin is a JavaScript object that has an apply method. This apply method is called by the webpack compiler, giving access...
Read more >
ts-loader - npm
There are 4305 other projects in the npm registry using ts-loader. ... You will also need to install TypeScript if you have not...
Read more >
FAQ | Vetur - GitHub Pages
Vetur can't recognize components imported using webpack's alias ... If you are getting a lot of Property 'xxx' does not exist on type...
Read more >
How to fix 'Property does not exist on type Window in ...
If you need anything not defined in this list, however, then that's when you'll hit the Property does not exist on type 'window...
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