Updating from beta.5 to beta.6 broke something fierce. And beta.7 doesn’t look any different.
I can confirm that import '/client/file'
does not work. Wish it did, sometimes the relative paths get out of control! BTW @SkinnyGeek1010, I don’t have to use ‘.js’ but I do have to use ‘.jsx’ for extensions. Also, if I have /lib/methods/index.js
, I can do:
import '../methods';
and that seems to work.
I haven’t tried import * as something from 'blah'
yet.
Oh, another nice surprise is that process.env.NODE_ENV
seems to be present on both client and server now, automatically! Previously it was only on the server side I believe. Very handy.
I couldn’t find such a file. The error appeared after updating from beta.6 to beta.7. When I downgrade to beta.6 everything works fine. I run it on a windows system.
Hrm. That’s strange. I see that Mantra uses the non-relative syntax — https://github.com/mantrajs/mantra-sample-blog-app/blob/master/client/configs/context.js#L1
I tried it and it works for me on beta 7.
I had the same issue. If you want to keep your import syntax, you can simply change your export to:
export {
a: 1,
b: 2
}
See my issue https://github.com/meteor/meteor/issues/6121
@ffxsam @SkinnyGeek1010 I don’t know what you guys are doing but both importing absolute paths and omitting the extension for js worked for me since beta4 (where I started):
import {maps} from '/modules/enums/maps';
import {GameArea} from '/modules/enums/enums';
are you sure lib
and client
are root level folders?
non-js extensions don’t resolve
In other news, loving the speed improvement in beta7, compile time is down to about ~4 secs from 12 in beta5.
However, if I keep compiling, after 10-15minutes it slows down to ~10secs and then I have to restart meteor.
Doh! i’m an idiot. Thanks for the clarification. Indeed it was both/lib
and not lib/
My reload time has dropped by about half so far… haven’t used it long enough to tell if it decays.
Oh, maybe I was doing it wrong by doing import '/client/file'
vs import 'client/file'
. I’ll give it a shot.
New release!
To update to the latest beta release, run the following command in your meteor project:
meteor update --release 1.3-modules-beta.8
Changes: https://github.com/meteor/meteor/issues/5788#issuecomment-180643955
Bingo, import {saveColor} from '/lib/methods'
worked. The leading /
was needed. I don’t know when absolute paths were added, but thank you!
That’s awesome. Are you registering a hook before insert operation to validate the object using Yup? (Perhaps using something like collection-hook)
No, not really because I’m doing all write operations via methods and I’m also using MySQL.
Has anyone successfully deployed a version 1.3 app to a hosting provider?
I found out that debugging was set in an enviroment variable. If you want to see debug messages, now you have to disable bable messages like DEBUG=*,-babel*
You can deploy your prototypes for free to galaxy using meteor deploy <app>
from your app dir.
I was referring more to deployment to hosting providers that require buildpacks like IBM BLuemix, Modulus, Heroku, Digital Ocean. Has anyone deployed a version 1.3 app to any of them? If so, did the buildpacks need tweaking?
I tried Heroku but no luck so far. If I succeed in tweaking the buildpack to work with 1.3 I will let you know.
For me importing absolute paths is not working if I work within package.
I got it to work by running npm install before the bundle process.
My repo:
https://github.com/mdrnize/meteor-buildpack-horse/blob/master/bin/compile#L69:L72
If you want to use it, remember to change it back. I will delete (edit: the repo) it when it gets fixed.