Skip to content
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

[Tests] E2E tests are failing because of Babel 6 not being able to find its plugins #4137

Closed
ide opened this issue Nov 15, 2015 · 13 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ide
Copy link
Contributor

ide commented Nov 15, 2015

Logs:

This will walk you through creating a new React Native project in /private/tmp/react-native-xNeadCtD/EndToEndTest
Installing react-native package from npm...
/private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:195
          throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i));
          ^
ReferenceError: Unknown plugin "syntax-async-functions" specified in "foreign" at 0
    at /private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:195:17
    at Array.map (native)
    at Function.normalisePlugins (/private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:175:20)
    at OptionManager.mergeOptions (/private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:273:36)
    at compile (/private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/node_modules/babel-register/lib/node.js:87:15)
    at loader (/private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/node_modules/babel-register/lib/node.js:128:14)
    at Object.require.extensions.(anonymous function) [as .js] (/private/tmp/react-native-xNeadCtD/EndToEndTest/node_modules/react-native/node_modules/babel-core/node_modules/babel-register/lib/node.js:138:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
./scripts/e2e-test.sh: line 20:  1794 Killed: 9               sinopia --config $SCRIPTS/e2e-sinopia.config.yml

cc @tadeuzagallo @frantic

I updated Babel and the plugins just in case it would fix things, but it didn't: https://travis-ci.org/facebook/react-native/builds/91186532.

Babel shouldn't be this hard to get running correctly. Perhaps Babel 6's algorithm for resolving plugins should be patched to include Babel 5's behavior?

@mkonicek
Copy link
Contributor

Thanks for looking into it James! Tadeu found out it's a bug in Babel and Sebastian is going to fix it. That way we can cut the next release branch.

@ide
Copy link
Contributor Author

ide commented Nov 17, 2015

Nice work London team :)

@sebmck
Copy link
Contributor

sebmck commented Nov 19, 2015

I'm having a lot of difficulty trying to run the tests:

$ ./scripts/e2e-test.sh
/Users/sebmck/.nvm/versions/node/v4.1.0/bin/sinopia
{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
npm WARN using --force I sure hope you know what you are doing.
▐ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
▐ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
npm WARN using --force I sure hope you know what you are doing.
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
+ [email protected]
+ [email protected]
/Users/sebmck/.nvm/versions/node/v4.1.0/bin/react-native -> /Users/sebmck/.nvm/versions/node/v4.1.0/lib/node_modules/react-native-cli/index.js
/Users/sebmck/.nvm/versions/node/v4.1.0/lib
└── [email protected]

This will walk you through creating a new React Native project in /private/tmp/react-native-xS11Vos6/EndToEndTest
Installing react-native package from npm...
Setting up new React Native app in /private/tmp/react-native-xS11Vos6/EndToEndTest
To run your app on iOS:
   Open /private/tmp/react-native-xS11Vos6/EndToEndTest/ios/EndToEndTest.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   Have an Android emulator running (quickest way to get started), or a device connected
   cd /private/tmp/react-native-xS11Vos6/EndToEndTest
   react-native run-android
Flow server launched for /private/tmp/react-native-xS11Vos6/EndToEndTest

Spawned flow server (child pid=18140)
Logs will go to /tmp/flow/zSprivatezStmpzSreact-native-xS11Vos6zSEndToEndTest.log
No errors!
ERROR: SDK 'iphonesimulator' doesn't exist.  Possible SDKs include:


./scripts/e2e-test.sh: line 20: 18327 Killed: 9               ../node_modules/react-native/packager/packager.sh --nonPersistent
 ┌────────────────────────────────────────────────────────────────────────────┐
 │  Running packager on port 8081.                                            │
 │                                                                            │
 │  Keep this packager running while developing on any JS projects. Feel      │
 │  free to close this tab and run your own packager instance if you          │
 │  prefer.                                                                   │
 │                                                                            │
 │  https://github.com/facebook/react-native                                  │
 │                                                                            │
 └────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
   /private/tmp/react-native-xS11Vos6/EndToEndTest

~/Scratch/react-native [master]$ [5:28:41 PM] <START> Building Dependency Graph
[5:28:41 PM] <START> Crawling File System
[5:28:41 PM] <START> Loading bundles layout
[5:28:41 PM] <END>   Loading bundles layout (0ms)

React packager ready.

[5:28:42 PM] <END>   Crawling File System (1228ms)
[5:28:42 PM] <START> Building in-memory fs for JavaScript
[5:28:43 PM] <END>   Building in-memory fs for JavaScript (262ms)
[5:28:43 PM] <START> Building in-memory fs for Assets
[5:28:43 PM] <END>   Building in-memory fs for Assets (251ms)
[5:28:43 PM] <START> Building Haste Map
[5:28:43 PM] <START> Building (deprecated) Asset Map
[5:28:43 PM] <END>   Building (deprecated) Asset Map (49ms)
[5:28:43 PM] <END>   Building Haste Map (320ms)
[5:28:43 PM] <END>   Building Dependency Graph (2067ms)

Is there any instructions on how to actually setup a local React Native dev environment?

@ide
Copy link
Contributor Author

ide commented Nov 19, 2015

@sebmck It looks like you need to install Xcode and set up the iOS development environment. Your Node version and nvm setup look fine.

@sebmck
Copy link
Contributor

sebmck commented Nov 19, 2015

@ide Are there any instructions anywhere? Having a hard time debugging this because I've never done iOS/mobile dev before.

@brentvatne
Copy link
Collaborator

@sebmck - I believe that all you need to do is download XCode through the App Store

@sebmck
Copy link
Contributor

sebmck commented Nov 19, 2015

Looks like I forgot to actually open Xcode and install the required components... Thanks for the help!

@sebmck
Copy link
Contributor

sebmck commented Nov 19, 2015

I can't reproduce this locally so this looks like it's just a Travis environment issue? Full log here.

@ide
Copy link
Contributor Author

ide commented Nov 19, 2015

If you revert c6a3052 I think the issue will resurface if invoke packager/launchPackager.command from outside of the react-native directory. I was seeing the same error message on my computer (OS X).

You might want to try with Node 4.2.2 (just a different .nvm install without all your global modules, in case those are affecting things)?

@sebmck
Copy link
Contributor

sebmck commented Nov 19, 2015

Same thing with Node 4. I reverted that commit and the tests also ran successfully, log here.

@ide
Copy link
Contributor Author

ide commented Nov 19, 2015

The E2E test fails for me on master: https://gist.github.com/ide/60a5fb5a5352226a4e1e.

On master, this is what I get when running packager/launchPackager.command outside the repo directory:

$ git revert c6a3052
$ nvm use default
Now using node v4.2.1 (npm v2.14.7)

$ npm i
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install /Users/ide/Code/react-native/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/ide/Code/react-native/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

$ cd ..
$ react-native/packager/launchPackage.command
/Users/ide/Code/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:181
          throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i));
          ^

ReferenceError: Unknown plugin "syntax-async-functions" specified in "foreign" at 0
    at /Users/ide/Code/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:181:17
    at Array.map (native)
    at Function.normalisePlugins (/Users/ide/Code/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:163:20)
    at OptionManager.mergeOptions (/Users/ide/Code/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:36)
    at compile (/Users/ide/Code/react-native/node_modules/babel-register/lib/node.js:87:15)
    at loader (/Users/ide/Code/react-native/node_modules/babel-register/lib/node.js:128:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/ide/Code/react-native/node_modules/babel-register/lib/node.js:138:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
Process terminated. Press <enter> to close the window

My suspicion is that something about your PATH or global node_modules is different than mine and you might have Babel plugins in places that I don't.

@sebmck
Copy link
Contributor

sebmck commented Nov 19, 2015

Was able to repro with those commands, thanks @ide! Just pushed out 6.2.0 that should fix this. Sorry for the delay in getting this fixed.

@ide
Copy link
Contributor Author

ide commented Nov 19, 2015

@sebmck awesome! Thank you for looking into this.

cc @tadeuzagallo @mkonicek could you guys update node_modules and npm-shrinkwrap.json? The upgrade should be quite straightforward and not require extra effort to get things working (only minor version updates of Babel).

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants