You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice work with this repo!
My app apparently requires "vm", but the "vm-browserify" alias was removed (in c0fb559).
Can you explain why? Is there a specific reason?
vm-browserify uses window.document and dom elements in its implementation, so it won't work in RN. I don't know of a RN-compatible polyfill for vm, but it may be possible to create one. It'd be great if you can contribute one! Or even a "mock" one that stubs out empty functions if that's all you need to get your library working.
Okay, thank you for the explanation. A mock would propably enough for my usage, but i got it working with adding vm-browserify (i think it is not using the the function at all but just checks if the library is there?) with configuring the rn-cli.config.js like:
Am having the same issue. @parshap what would be an acceptable solution? a mock or actually using vm-browserify ? if so will create a pull request to cover the VM case
Activity
parshap commentedon Mar 20, 2018
vm-browserify uses
window.documentand dom elements in its implementation, so it won't work in RN. I don't know of a RN-compatible polyfill for vm, but it may be possible to create one. It'd be great if you can contribute one! Or even a "mock" one that stubs out empty functions if that's all you need to get your library working.kegesch commentedon Mar 20, 2018
Okay, thank you for the explanation. A mock would propably enough for my usage, but i got it working with adding vm-browserify (i think it is not using the the function at all but just checks if the library is there?) with configuring the
rn-cli.config.jslike:ka-sh commentedon Jul 11, 2018
Am having the same issue. @parshap what would be an acceptable solution? a mock or actually using vm-browserify ? if so will create a pull request to cover the VM case
parshap commentedon Jul 12, 2018
I think a mock is the best solution unless you actually need sandboxing for security. Adding a
vmmock tomock/would be awesome.toddpi314 commentedon Nov 29, 2018
note above, you might want to use the
resolversyntax:I'm not sure how @Y0nnyy's original snippet would work without that..
devesrawat commentedon Dec 24, 2019
Can't find variable
btoaafter addingmetro.config.jspcowgill commentedon Dec 30, 2019
Yep, and in addition to using
resolversyntax, these days the file would be namedmetro.config.jsrather thanrn-cli.config.js