Meteor 1.3.rc-4 import from imports folder

I am following the directory structure at http://guide.meteor.com/v1.3/structure.html. I tried below with rc3 & rc4 both (and beta earlier).

I have routes.jsx in imports/startup/client folder.

In client/main.js I am trying to import the routes.jsx, but it is not working. The path patterns that I tried are:

  1. import ‘/imports/startup/client’; (referred from https://github.com/meteor/todos/blob/master/client/main.js)
  2. import ‘/imports/startup/client/routes.jsx’;
  3. import ‘./…/imports/startup/client’;
  4. import ‘./…/imports/startup/client/routes.jsx’;
  5. import ‘…/imports/startup/client’;
  6. import ‘…/imports/startup/client/routes.jsx’;

But I keep getting this error (as seen in browser console)

Error: Cannot find module '/imports/startup/client’
require()
modules-runtime.js:105
require<.client[“main.js”]<()
app.js:126
fileEvaluate()
modules-runtime.js:168
require()
modules-runtime.js:102

What is the correct way to import from imports folder in client ?

Off-topic: Is 1.3 released? Where did you find that guide?

1.3 is not yet released, but I found the guide at http://guide.meteor.com/v1.3/

1 Like

Just checked our code (also with file structure copied from the latest Todos example) and we have the same as your version 6, but without the semi-colon: import '../imports/startup/client/routes.jsx'

I’m not convinced that’s your issue though, if you get that exact same error no matter what you try then it seems like you must be trying to import '/imports/startup/client' somewhere, I’d search your code for that. Failing that, maybe try meteor reset or clearing your browser cache (clutching at straws a bit there!).

Feeling stupid at my mistake. As you suggested I searched the project and found that the error was coming from somewhere else.

Thank you for your time and tip. :slight_smile:

1 Like