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-root-slash-import breaks Meteor build #82

Open
gadicc opened this issue Mar 18, 2016 · 6 comments
Open

babel-root-slash-import breaks Meteor build #82

gadicc opened this issue Mar 18, 2016 · 6 comments

Comments

@gadicc
Copy link

gadicc commented Mar 18, 2016

The latest version of meteor-react-hotloader introduces .babelrc support. But the babel-root-slash-import plugin breaks the Meteor build process, I get an error like:

 Error: Cannot find module '/home/dragon/www/tmp/mantra-sample-blog-app/lib/collections'
     at require (/home/dragon/www/tmp/mantra-sample-blog-app/.meteor/local/build/programs/server/packages/modules-runtime.js:95:19)
     at meteorInstall.server.configs.initial_adds.js (server/configs/initial_adds.js:3:16)
     at fileEvaluate (/home/dragon/www/tmp/mantra-sample-blog-app/.meteor/local/build/programs/server/packages/modules-runtime.js:158:9)
     at require (/home/dragon/www/tmp/mantra-sample-blog-app/.meteor/local/build/programs/server/packages/modules-runtime.js:92:16)
     at /home/dragon/www/tmp/mantra-sample-blog-app/.meteor/local/build/programs/server/app/app.js:269:1
     at /home/dragon/www/tmp/mantra-sample-blog-app/.meteor/local/build/programs/server/boot.js:281:10
     at Array.forEach (native)
     at Function._.each._.forEach (/home/dragon/.meteor/packages/meteor-tool/.1.2.4-rc.2.17279bz++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
     at /home/dragon/www/tmp/mantra-sample-blog-app/.meteor/local/build/programs/server/boot.js:133:5

I guess because this is emulating Meteor's behaviour outside of Meteor but inside of Meteor it overrides / breaks it :) Not sure if this has been an issue with webpack:webpack too? But inevitably Meteor will support .babelrc in post-1.3 anyway.

Hope this is the right place for this issue (the repo has issues disabled, but this is mostly about using it inside of Meteor which isn't it's original use case). Not sure how you'd want to best handle this case.

@xcv58
Copy link
Contributor

xcv58 commented Mar 18, 2016

I'm facing similar issue several days ago. But it seems MDG disable .babelrc support in beta.12.

But the babel-root-slash-import works fine for webpack:webpack package. You can check my ongoing project: https://github.com/ops-class/test161-web-ui/blob/master/app/package.json#L38

@gadicc
Copy link
Author

gadicc commented Mar 18, 2016

Ah oops, actually, I guess it works in webpack:webpack because Meteor's not building it there :> Yeah, official .babelrc was disabled but it will be back post-1.3 and then this will be an issue again with official Meteor. In the meantime, react-meteor-hotloader now re-introduces some better integrated .babelrc support usable today in 1.3-rc.2 (with the intention of submitting as a PR back to core).

@xcv58
Copy link
Contributor

xcv58 commented Mar 18, 2016

Sure, the webpack:webpack takes over the building process. So it's fine.

It's an issue when Meteor enables .babelrc again.

@arunoda
Copy link
Contributor

arunoda commented Mar 24, 2016

I think if it's the time for .babelrc in meteor, we can try to use this only when mantra running tests rather doing this in the .babelrc.

@THPubs
Copy link

THPubs commented Jun 22, 2016

Now if you update to the latest stable version of meteor, this issue will come. Ref : https://forums.meteor.com/t/1-3-3-imports-breaking/24890

@arunoda
Copy link
Contributor

arunoda commented Jun 23, 2016

Guys, I just introduce a new version of babel-root-slash-import which works properly inside Meteor.

I've updated this repo to use it.

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

4 participants