$traceurRuntime is not defined

When I run
donejs build
and then
NODE_ENV=production donejs start
I get this error

Potentially unhandled rejection [2] ReferenceError: Error loading “swimming@0.0.0#index.stache!done-autorender@0.8.0#autorender” at file:…/src/index.stache
$traceurRuntime is not defined
at Function. (file:…/dist/bundles/can/util/vdom/vdom.js:28:251)

This happens on a completely new donejs app (right after running donejs add app my-app)

Any idea what might be wrong?
Thanks!

I got the same problem also when i try with the “Quick start: donejs-chat” example.

Potentially unhandled rejection [2] ReferenceError: Error loading "donejs-chat@0.0.0#index.stache!done-autorender@0.8.0#autorender" at file:/project/donejs-chat/donejs-chat/src/index.stache
$traceurRuntime is not defined
    at Function.<anonymous> (evalmachine.<anonymous>:28:251)
at Function.<anonymous> (evalmachine.<anonymous>:28:251)
    at define.execute (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1416:32)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:668:32)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)
    at linkDynamicModule (/project/donejs-chat/donejs-chat/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:662:11)

what operating system are you using? What version of node?

Op is an Ubuntu 14.04.5 LTS.
node version: v0.10.25
npm version: 1.3.10

The example (donejs-chat) works well in develop mode. I got the problem when I try to build it in production mode.

Thank you for your help.

OS X El Capitan
node 5.4.1
npm 3.8.2

Thanks for your help, Justin! :slight_smile:

I checked if there could be some conflict due to previous installed library: I created a new VM with a dedicated environment for DoneJS, with npm 2.15.9 and node v4.6.1.
The problem still remains: it seems that the global variable $traceurRuntime is not seen due to the change of environment (NODE_ENV=production).

Since I don’t see traceur/traceur-runtime package inside the node_modules dir I tried to force it adding the dependency in packet.json (dependencies object) and I installed them directly but without results :sweat:

{
  "dependencies": {
  "traceur": "0.0.87",
    .....
  },

  ...

  "system": {
    "meta": {
      "traceur": {
        "exports": "$traceurRuntime"
      }
    }
  }
}

Maybe I forgot something?
I got the same problem with the second (in-dept) tutorial.
Maybe something regarding stealJS configuration?

Hey @fp_dev, sorry for taking so long to respond. That definitely sounds like a bug to me. steal-tools is supposed to automatically add the traceurRuntime if it detects that it’s needed. We have tests for this.

If you’re still having this issue please file an issue at https://github.com/stealjs/steal-tools and I’ll take a look.

Hi @matthewp,

I tried again and the building process works correctly.
I create the project from the beginning, downloading the app template from scratch because i saw that in the meanwhile there have been some version updates.

Thanks a lot!

2 Likes