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

Babel not transpiling when using next@2.0.0-beta.24 #1042

Closed
angel200sdnot opened this issue Feb 8, 2017 · 7 comments
Closed

Babel not transpiling when using next@2.0.0-beta.24 #1042

angel200sdnot opened this issue Feb 8, 2017 · 7 comments
Assignees

Comments

@angel200sdnot
Copy link

If i use the beta 24 babel stops transpiling the code and simply copies the original into the output folder, reverting back to beta 20 fixes this issue

i have this on my package.json

"babel": {
    "presets": [
      "next/babel"
    ],
    "ignore": [
      ".next",
      "build"
    ]
}
@timneutkens
Copy link
Member

Can you try using .babelrc I believe we don't support having the config in package.json

@angel200sdnot
Copy link
Author

angel200sdnot commented Feb 8, 2017

@timneutkens I did try that and it still wasn't working

The config in package.json is working as intended because the custom server transpiling is being done by babel outside of next with the following command

"build": "node_modules/.bin/babel ./ --out-dir build --ignore node_modules && cp -r static build"

Then i build next using

"build-next": "cd build && next build"

and finally run the server

"start": "NODE_ENV=production PORT=9000 node build/server.js"

I didnt try using beta21-23, i will do that and post back the results

@arunoda
Copy link
Contributor

arunoda commented Feb 8, 2017

@timneutkens We do support babel config in the package.json as well.

@angel200sdnot could you send us a sample repo and tell us the exact error you are getting.

@angel200sdnot
Copy link
Author

@arunoda Here is the sample repo https://github.com/angel200sdnot/sample_repo
If you run the build script it wont transpile the code correctly, but if you roll back to next@2.0.0-beta.20 it will work correctly

@bukinoshita
Copy link
Contributor

bukinoshita commented Feb 12, 2017

It works just fine on next@2.0.0-beta.21, beta22-24 doesn't work. Used the same example on the examples folder

@arunoda arunoda self-assigned this Feb 12, 2017
@arunoda
Copy link
Contributor

arunoda commented Feb 12, 2017

Okay. Here's what's happening.
You are using next/babel here to compile your own code.
But we don't transpile import/export code.

I've seen many cases like this. So, I'd like to fix this directly.

Note: when invoked next/babel directly. We should transpile import/export as well.

@timneutkens
Copy link
Member

I'm going to close this issue. Same as the pr #1095

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants