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

Not working with Meteor 1.3.3.1 #121

Open
kachkaev opened this issue Jun 20, 2016 · 4 comments
Open

Not working with Meteor 1.3.3.1 #121

kachkaev opened this issue Jun 20, 2016 · 4 comments

Comments

@kachkaev
Copy link

kachkaev commented Jun 20, 2016

Description of Problem

I upgraded to 1.3.3.1 and noticed a strange error: the result of imports became undefined. E.g.

imports/fortytwo.js

export const fortytwo = 42;

server/index.js

import { Meteor } from 'meteor/meteor';
import { fortytwo } from '/imports/fortytwo.js';

Meteor.startup(() => {
  console.log('fortytwo is ' + fortytwo); // -> fortytwo is undefined
});

The problem with imports occurs only after switching to hmr, all is fine by default in 1.3.3.1. The problem did not appear on Meteor 1.3.3.

MWE

https://github.com/kachkaev/meteor-modules-test

Environment

  • Meteor version: 1.3.3.1
  • ecmascript-hot version: 2.0.0-beta.5
  • Operating System: Ubuntu
@kachkaev
Copy link
Author

For those who is facing the same issue and wants to temporary remove meteor-hmr instead of rolling back to 1.3.3:

meteor remove gadicc:ecmascript-hot
meteor add ecmascript
npm rm --save-dev babel-preset-meteor
rm .babelrc

@gadicc
Copy link
Owner

gadicc commented Jun 20, 2016

Thanks for the detailed report. I haven't had a chance to test this exact case yet, but Meteor 1.3.3.1 is working fine so far for me with the latest code base, which I just published now as gadicc:[email protected]. Could you try that one and see if it behaves any differently?

Btw, since Meteor 1.3.3 we don't need the babel-preset-meteor anymore... and Meteor works with .babelrc on it's own. It's safe to leave the react-hot-loader in your .babelrc even without meteor-hmr, even though in this case it won't do that much.

@kachkaev
Copy link
Author

The new beta.6 brought things back to work in 1.3.3.1, thank you!

Although .babelrc does not need to contain anything meaningful, it seems that the file is still required and it cannot be blank. Will it be possible for meteor-hmr to treat an absent or an empty .babelrc as one with {}? Just to remove an extra step of adding this.

One more quick comment: it is not very clear from the repo what's the latest beta at the moment. This information can be often found from the repo tags or releases, which do not exist. https://atmospherejs.com/gadicc/ecmascript-hot does not tell anything about beta's either. Perhaps, a reference to the latest beta in README.md can save some time to the newbies.

@Vincent-P
Copy link

Yes README.md definitely needs an update.

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

3 participants