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 v0.16 causes Transform error #558

Closed
adriansdev opened this issue Dec 4, 2015 · 17 comments
Closed

React Native v0.16 causes Transform error #558

adriansdev opened this issue Dec 4, 2015 · 17 comments

Comments

@adriansdev
Copy link

Hi

I have just updated RN to v0.16 and see this error which I assume is due to the Babel updates in RN

TransformError: /Users/…/node_modules/alt/lib/index.js: [BABEL] /Users/…/node_modules/alt/lib/index.js: Unknown option: /Users/…/node_modules/alt/.babelrc.stage

Removing .babelrc seems to fix the problem

@cnjsstong
Copy link

+1

Same here. Removing .babelrc fixed the issue.

@sebmck
Copy link

sebmck commented Dec 5, 2015

.babelrc should be added to .npmignore if you're publishing the package prebuilt.

@taion
Copy link
Collaborator

taion commented Dec 5, 2015

Better to use package.files instead of .npmignore IMO. I noted this at #543 (comment).

@taion
Copy link
Collaborator

taion commented Dec 5, 2015

Although note we are ignoring .babelrc:

.babelrc

@myusuf3
Copy link

myusuf3 commented Dec 7, 2015

so whats the work around for this?

@goatslacker
Copy link
Owner

I'll use package.json files and publish a new build.

@ljharb
Copy link

ljharb commented Dec 9, 2015

.babelrc should be added to .npmignore if you're publishing the package prebuilt.

@sebmck why, if i'm also including the original source in the distribution alongside the compilation output?

@rainer-liao
Copy link

Remove .babelrc haven't fix the problem

@athena0304
Copy link

so how to solve this problem?

@enix223
Copy link

enix223 commented Feb 12, 2016

Remove .babelrc did solve this issue.

@JonathanZWhite
Copy link

Seems like .babelrc in npm packages cause this issue and running npm run clean after install should do the trick. The npm script is below.

"clean": "find ./node_modules -name react-packager -prune -o -name '.babelrc' -print | xargs rm -f",
"postinstall": "npm run clean"

@ljharb
Copy link

ljharb commented Feb 14, 2016

imo this is a babel bug. Each module should be able to declare its own babel version and transformation settings, and include these with the published package.

@zsading
Copy link

zsading commented Mar 1, 2016

Removing .babelrc works for me

@ellyliang
Copy link

Removing .babelrc works for me +1

@yreenchan
Copy link

Removing .babelrc doesn't works for me, what should I do to solve the problem?

@artokun
Copy link

artokun commented Jul 21, 2016

If the .babelrc problem is persisting even though you create a new project run the following command provided by @JonathanZWhite

find ./node_modules -name react-packager -prune -o -name '.babelrc' -print | xargs rm -f

@StormFactory
Copy link

I had the same error after creating the default project using react-native init [project] using react-native v0.42.2.

Opening up the project in Visual Studio Code and renaming .babelrc fixed the problem so ignoring it would still work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests