0

I just upgraded my Windows Meteor from 0.5.4 to 0.6.4.1. I am on Windows 7. After upgrade my working code crashed with the following error messages:

Errors prevented startup:
Exception while bundling application:
TypeError: Cannot read property 'raw' of undefined
at C:\Program Files (x86)\Meteor\packages\meteor\package.js:15:15
at _.extend.add_file (C:\Program Files (x86)\Meteor\app\lib\bundler.js:201:5)
at self.api.add_files (C:\Program Files (x86)\Meteor\app\lib\bundler.js:102:16)
at Array.forEach (native)
at Function..each..forEach (C:\Program Files (x86) \Meteor\lib\node_modules\underscore\underscore.js:78:11)
at self.api.add_files (C:\Program Files (x86)\Meteor\app\lib\bundler.js:101:11)
at Array.forEach (native)
at Function..each..forEach (C:\Program Files (x86) \Meteor\lib\node_modules\underscore\underscore.js:78:11)
at Object.self.api.add_files (C:\Program Files (x86)\Meteor\app\lib\bundler.js:100:9)
at null.on_use_handler (C:\Program Files (x86)\Meteor\packages\underscore\package.js:7:7)
Your application is crashing. Waiting for file change.

Jules
  • 153
  • 1
  • 12

2 Answers2

1

As the two stack trace entries for bundler.js don't seem to tally with what I would expect for 0.6.4.1, there is a possibility that the MSI upgrade didn't work properly (MSI uses hashes to determine if text files are up-to-date).

I would suggest that you try:

  1. Uninstalling Meteor from Control Panel -> Add/Remove programs.
  2. Check that you have no files left in program files \Meteor.
  3. Re-install using the 0.6.4.1 installer.
  4. Check the installation works on the todos example (see below)
  5. Try your app.

To check that the install is working sensibly, create one of the example apps and check it runs:

meteor create --example todos
cd todos
meteor
StephenD
  • 3,662
  • 1
  • 19
  • 28
  • The 0.6.4.1 MSI upgrade likely didn't work properly. Following your device to Control Panel => Programs => Programs and Features to uninstall Meteor 0.6.4.1 I noticed that Meteor 0.5.4 was still installed. After uninstalled both and reinstall 0.6.4.1 now the code is crashing inside my program, I guess it has something to do with changes of Meteor support. Back to debugging. Thanks – Jules Aug 08 '13 at 13:56
  • It looks like _meteor_bootstrap_.require has been changed or moved? The code I inherited use _meteor_bootstrap_.require to load module and it's no longer working with 0.6.4.1? require = __meteor_bootstrap__.require Future = require (fibers/future) – Jules Aug 08 '13 at 15:16
  • 1
    As per http://stackoverflow.com/a/18131165/1129543 the official way to require an NPM package is now `Npm.require()` however this is probably only accessible to packages. – StephenD Sep 28 '13 at 05:08
  • Yes, I have done that. I should have come back and provided updates. That worked. – Jules Sep 30 '13 at 13:20
0

Since 0.5.4 there have been a couple of changes. The big one being variable scoping.

If there is a variable in a file & you want to access that variable from another file you have to scope it globally.

i.e if you have

var x = true;

You have to change it to

x = true;

The same for a function:

function foo() { return "bar"; }
//or
var foo = function() { return "bar;"}

becomes

foo = function() { return "bar"; };

You have to go through your files an alter these.

Alternatively you could move your files to a new /compatibility directory where they wont be variable scoped.

Tarang
  • 75,157
  • 39
  • 215
  • 276
  • It's a helpful hint. Though not directly related to my original question, it does help me in my upgrade process. – Jules Aug 08 '13 at 21:15