AgedLace
AgedLace

Reputation: 41

Meteor simple-todos tut - Step 2 - Uncaught Error Cannot find module './template.body.js

I have created a debian virtual machine where I have installed meteor version 1.4.2.

I am working on the simple-todos meteor tutorial, blaze view.

I have done everything on step 2 [several times; even to the point of deleting and starting over many times]; I've even done straight c&p of all the code into the various files. I have spent several hours searching google; git-hub, and stackoverflow and have not found anything that seems to relate to my problem.

When I look at the app in the browser, the page is blank ... when I look in the console I have the following error code:

Uncaught Error: Cannot find module './template.body.js'
    at require (http://localhost:3000/packages/modules-runtime.js?hash=ab7e8d32b6c7b5a5fa7ae1b65e8225c4f9e30223:119:19) [this error continues with a lot more references and hashes, but I can't post more than 2 links]

If someone could at least point me in the right direction so I can continue to research this, I would be most grateful.

Upvotes: 3

Views: 1293

Answers (4)

Sebk
Sebk

Reputation: 1

I am running meteor on a Mac using blaze templating. I have done the following steps and it has worked:

  • make sure that the import statement is in client/main.js and not in server/main.js
  • make sure that 'blaze-html-templates' is installed
  • ensure that imports folder is typed correctly
  • Restart the server
  • If everything else fails, you can reset your project using 'meteor reset'

Hope this helps.

Upvotes: 0

Fábio Queluci
Fábio Queluci

Reputation: 311

Set your project's Meteor version to a previous one:

meteor update --release 1.4.1.3

(Thanks to diaconutheodor)

Source

Upvotes: 2

Asaf Agranat
Asaf Agranat

Reputation: 402

I'm experiencing the same. I did as user Shaun Stoltz suggested (restart Meteor), and it did work. But then I added more files to the imports folder, and the error recurred, now referencing the new file missing 'template...'.

I gave Meteor another restart, and the build worked again.It seems that meteor omits the new files from the build while it's watching. Only upon restart the new files get included. This is a real nuisance as while following contemporary componental approach, i will be creating many small files, and restarting Meteor repeatedly is going to exhaust.

Are there other users experiencing this issue?

Upvotes: 2

Shaun Stoltz
Shaun Stoltz

Reputation: 166

OK, that's weird... I replicated what you were seeing. It happens when you have meteor RUNNING while doing this coding, so it is doing live code update, but the module is not being built/included properly.

All I did was STOP and restart Meteor. And it worked.

Not sure why it is not loading the modules in a rebuild and hot code push, but there you have it, that's the fix.

Here is my shell so you see what I did:

shaunst:~/workspace $ curl https://install.meteor.com/ | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7784    0  7784    0     0  23942      0 --:--:-- --:--:-- --:--:-- 23950
Downloading Meteor distribution
######################################################################## 100.0%

Meteor 1.4.2 has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your convenience.
This may prompt for your password.

To get started fast:

  $ meteor create ~/my_cool_app
  $ cd ~/my_cool_app
  $ meteor

Or see the docs at:

  docs.meteor.com

shaunst:~/workspace $ meteor create simple-todos
Created a new Meteor app in 'simple-todos'.                                        

To run your new app:                          
  cd simple-todos                             
  meteor                                      

If you are new to Meteor, try some of the learning resources here:
  https://www.meteor.com/learn                

shaunst:~/workspace $ cd simple-todos/        
shaunst:~/workspace/simple-todos $ meteor npm install
simple-todos@ /home/ubuntu/workspace/simple-todos
└─┬ [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   └── [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ └── [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ └── [email protected] 
  │ │   └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├── [email protected] 
  │ │   └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ └── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   └── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ └── [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ └── [email protected] 
  │ │   └── [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  └─┬ [email protected] 
    └── [email protected] 

shaunst:~/workspace/simple-todos $ meteor --port 8080
[[[[[ ~/workspace/simple-todos ]]]]]          

=> Started proxy.                             
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:8080/
=> Meteor server restarted                    
=> Meteor server restarted                    
=> Meteor server restarted                    
=> Meteor server restarted                    
=> Client modified -- refreshing (x3)
=> Meteor server restarted                    
=> Meteor server restarted                    
=> Client modified -- refreshing^C
shaunst:~/workspace/simple-todos $ ^C
shaunst:~/workspace/simple-todos $ meteor --port 8080
[[[[[ ~/workspace/simple-todos ]]]]]          

=> Started proxy.                             
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:8080/
=> Client modified -- refreshing (x2)

Upvotes: 4

Related Questions