meteor-hmr icon indicating copy to clipboard operation
meteor-hmr copied to clipboard

Not working with Meteor 1.3.3.1

Open kachkaev opened this issue 9 years ago • 4 comments

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 avatar Jun 20 '16 10:06 kachkaev

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

kachkaev avatar Jun 20 '16 10:06 kachkaev

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.

gadicc avatar Jun 20 '16 13:06 gadicc

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.

kachkaev avatar Jun 20 '16 14:06 kachkaev

Yes README.md definitely needs an update.

Vincent-P avatar Jun 20 '16 14:06 Vincent-P