-
Notifications
You must be signed in to change notification settings - Fork 630
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
runBeforeMainModule is an empty array #78
Comments
Thanks for reporting! The commit that you pointed is in fact causing this issue. I'm going to add a fix for it. In the meantime, as a workaround, can you try to add a |
@rafeca Tried to work around the issue but could not figure it out. What do you mean by bundle entry point exactly? |
Shortly after posting I saw "react-native run-ios --device" runs:
So bundle entry point is index.js, sorry for that noise. Adding |
Did you add it before any other require in that file? What error message are you getting? |
Yes, added it before any other require in the file. Error message I am getting is: "ReferenceError: Can't find variable: process" |
|
oh, just realized that if you're using import syntax, you'll need to also import InitializeCore ( |
That was the case. That resolved it! Thanks so much! |
Summary: This diff fixes #78 by adding the `runBeforeMainModule` server parameter to the bundler. This is not the cleanest solution, but will be fixed once we use the Delta Bundler for builds from the CLI Reviewed By: davidaurelio Differential Revision: D6074469 fbshipit-source-id: 068926ef671d9f897ad9f1bd0540036a97340c00
Do you want to request a feature or report a bug?
report a bug
What is the current behavior?
runBeforeMainModule
is an empty array. I noticed thatrunBeforeMainModule
config was removed frommetro-bundler
in this commit Make the runBeforeMainModule config param to RN repo and make it absolute.runBeforeMainModule
is passed intoServer
instance in react-native local-cli.However,
runBeforeMainModule
is not passed into bundle options.In
shared/output/bundle.js
module,runBeforeMainModule
is not included whenpackagerClient.buildBundle
is called.In
Server/index
module,runBeforeMainModule
is also not included whenthis._bundler.bundle(options)
is called.If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.What is the expected behavior?
Shouldn't
this._opts.runBeforeMainModule
merged intooptions
whenthis._bundler.bundle(options)
is called inbuildBundle
function ofServer
module?Please provide your exact metro-bundler configuration and mention your metro-bundler, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: