I’ve got a file called api.js
that looks like this:
import { Meteor } from 'meteor/meteor'
if (Meteor.isServer) {
export * from './server/api.js'
} else {
export * from './client/api.js'
}
I believe I borrowed this sweet pattern from the Todos apps.
Anyway, since updating from 3.0.3 to 3.0.4, I get an error which says:
Error: Nested imports can not import an async module
To upgrade to 3.0.3 I had to restructure some stuff after getting this error, and I thought I’d moved beyond this.
I looked at the docs to fix the issue before but can’t find the relevant info now, or what the error means exactly in my case, or what changed between 3.0.3 and 3.0.4 that would cause this to break suddenly.
The error goes away if I reverting back to 3.0.3.
Any suggestions on what to do here?
The import subtree looks something like:
main.js
:
import '/imports/api/account/cart/methods.js'
// NB: relevant since I believe having nested imports in main.js makes it a an 'async module'
if (Meteor.isAppTest) {
import '/imports/api/test/server/methods.js'
import '/imports/api/test/server/publications.js'
}
imports/api/account/cart/server/methods.js
:
import { foo } from '/imports/api/account/cart/api.js'
/imports/api/account/cart/api.js
source is at the top of this post.
Any help would be appreciated. Thanks.