question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running a JSBundle in node

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
brentvatnecommented, May 11, 2016

so that I can simulate a full integration test without starting a simulator / web browser

Not to derail, but this sounds very interesting, could you provide any more details? Might further motivate people to work on this too 😃

0reactions
mkonicekcommented, Oct 27, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

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