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

React Native bundling error because of babel plugin in graphql package #163

Closed
mimamuh opened this issue May 2, 2016 · 8 comments
Closed
Assignees
Labels

Comments

@mimamuh
Copy link

mimamuh commented May 2, 2016

Hi, I installed the apollo-client on react-native and got this error:

transformed 1390/1392 (100%)[node-haste] Encountered an error while persisting cache:
ReferenceError: Unknown plugin "transform-runtime" specified in "/Users/9_Semester/node_modules/graphql/package.json" at 5, attempted to resolve relative to "/Users/9_Semester/node_modules/graphql"
at /Users/9_Semester/node_modules/babel-core/lib/transformation/file/options/option-manager.js:179:17
at Array.map (native)
at Function.normalisePlugins (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/options/option-manager.js:155:20)
at OptionManager.mergeOptions (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/options/option-manager.js:277:36)
at OptionManager.addConfig (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
at OptionManager.findConfigs (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/options/option-manager.js:419:30)
at OptionManager.init (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/options/option-manager.js:461:12)
at File.initOptions (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/index.js:194:75)
at new File (/Users/9_Semester/node_modules/babel-core/lib/transformation/file/index.js:123:22)
> TransformError: /Users/9_Semester/node_modules/graphql/language/parser.js: Unknown plugin "transform-runtime" specified in "/Users/9_Semester/node_modules/graphql/package.json" at 5, attempted to resolve relative to "/Users/9_Semester/node_modules/graphql"

After installing the babel-plugin-transform-runtime I got the same error with the preset es2015. After installing them both, it works.

@stubailo
Copy link
Contributor

stubailo commented May 2, 2016

That's odd - @martijnwalraven did you see this when working with react native?

@deoqc
Copy link

deoqc commented May 2, 2016

Had the same with respect to 'transform-runtime' as reported in this issue.

I already had preset ES2015 installed.

@stubailo
Copy link
Contributor

stubailo commented May 2, 2016

So is the solution to somehow declare those dependencies? It's kind of weird that the package.json of the graphql package is affecting us..

@martijnwalraven
Copy link
Contributor

Yes, I also had to install these manually, see here for the steps I followed. I linked to what might be a related issue about React Native's Packager there, but I don't fully understand what is going on or what we can do about it yet.

@stubailo
Copy link
Contributor

We can test out fixes with this boilerplate: https://github.com/scaphold-io/react-native-starter-kit

@stubailo stubailo changed the title Unknown plugin "transform-runtime" React Native bundling error because of babel plugin in graphql package Jun 28, 2016
@stubailo stubailo assigned stubailo and unassigned martijnwalraven Jun 28, 2016
@stubailo
Copy link
Contributor

I'm going to tackle React Native this week. It seems like just a very small modification would fix this bug, and then we can put React Native on the homepage.

@stubailo
Copy link
Contributor

Btw, link to the graphql bug: graphql/graphql-js#414

@stubailo
Copy link
Contributor

stubailo commented Jul 6, 2016

OK, I believe we have conclusively fixed this issue in Apollo Client version 0.3.27, which now depends on graphql-tag, which contains a pre-bundled GraphQL printer and parser to avoid the build issues. Let me know if this doesn't work! Big thanks to @abhiaiyer91 for building the bundle script.

@stubailo stubailo closed this as completed Jul 6, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants