Running a JSBundle in node
See original GitHub issueI am trying to execute a JSBundle in node so that I can simulate a full integration test without starting a simulator / web browser. However, it seems that the user of require
to load modules makes it impossible to load bundles in node.
Steps to reproduce:
react-native init MyProject && cd MyProject
react-native bundle --entry-file index.ios.js --bundle-output bundle.js
node bundle.js
Error: AssertionError: path must be a string
This can be fixed by adding a line require = global.require
to override the global node require
. However, it would be nice if the packager did not use the keyword require
for this so that the bundle does not to be post-processed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
jsbundle - npm
Simple, clean, and automatic bundling of your Node modules and packages ... Start using jsbundle in your project by running `npm i jsbundle`....
Read more >Bundle and Deploy my nodejs program as an executable
I want to run the program through cmd only with the the executable file name (without using npm run start or node file.js...
Read more >Bundling Applications with Webpack - AWS SDK for JavaScript
You can use webpack to generate bundles that run in Node.js by specifying it as a target in the configuration. ... This is...
Read more >First Time Deploying with React Native | by Cameron Bourke
To generate the main.jsbundle file, run the following: node node_modules/react-native/local-cli/cli.js bundle --entry-file='index.ios.js' ...
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Author your app or library using ES2015 modules, then efficiently bundle them up into a single file for use in browsers and Node.js....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not to derail, but this sounds very interesting, could you provide any more details? Might further motivate people to work on this too 😃
Hi there! This issue is being closed because it has been inactive for a while.
But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/running-a-jsbundle-in-node
Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.