[Solved] Error: Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?


#1

I am building my first private, local (Atmosphere) package with the ES6 import syntax instead of addFiles(). I am following the instructions of the Meteor Guide, which tells me to set my my mainModule and then import other files or components from that module.

However, when I try to import a local file located in the package folder routes/home.js from within client.js and server.js like this:

import 'routes/home'; 

the server crashes with this error message:

Error: Can't find npm module 'routes/home'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?

I found some similar posts here, but they all referred to imports from npm modules like react, in my case it’s just a package-local file. I have included the ecmascript package in my package.js, but this doesn’t help. Is there something else I am missing?


#2

Solved. The problem was that the files should be imported like this:

import './routes/home';