mantra-cli
mantra-cli copied to clipboard
Generating publications/methods and collections issue
Using Meteor 1.3.x, when creating a collection and then creating its respective publication and methods, Meteor crashes when running the server with an "Unable to resolve some modules:" error. The generated import is:
import {MyCollection} from '/lib/collections';
but it needs to be modified to the following for the error to go away:
import {MyCollection} from '../../lib/collections';
Hi @srbdev I think you have to add the babel-root-slash-import plugin to your babelrc:
{
"presets": ["es2015", "stage-2", "react"],
"plugins": ["react-require", "babel-root-slash-import",
....]
}
then, it can resolve imports that begin with "/" and are relative to your app-root
@macrozone I already have the entry in my .babelrc and the issue is still happening
@srbdev are you using the latest version of babel-root-slash-import
? See https://talk.mantrajs.com/t/meteor-1-3-3-and-imports/360/7