# $traceurRuntime is not defined

**URL:** <https://forums.bitovi.com/t/traceurruntime-is-not-defined/448>\
**Category:** DoneJS\
**Created:** [October 20, 2016, 3:43pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448 "2016-10-20T15:43:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dionesku](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@dionesku](https://forums.bitovi.com/u/dionesku)\
**Post date:** [October 20, 2016, 3:43pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/1 "2016-10-20T15:43:25Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [October 21, 2016, 10:51am UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/2 "2016-10-21T10:51:25Z")

</div>

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)
```

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [October 21, 2016, 1:39pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/3 "2016-10-21T13:39:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [October 21, 2016, 3:14pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/4 "2016-10-21T15:14:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dionesku](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@dionesku](https://forums.bitovi.com/u/dionesku)\
**Post date:** [October 21, 2016, 8:27pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/5 "2016-10-21T20:27:41Z")

</div>

OS X El Capitan  
node 5.4.1  
npm 3.8.2

Thanks for your help, Justin! 🙂

---

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [October 22, 2016, 3:04pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/6 "2016-10-22T15:04:42Z")

</div>

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 😓

```
{
  "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?

---

<div class="post-metadata">

**Author:** ![matthewp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/matthewp/32/77_2.png) [@matthewp](https://forums.bitovi.com/u/matthewp)\
**Post date:** [November 18, 2016, 6:08pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/7 "2016-11-18T18:08:31Z")

</div>

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](https://github.com/stealjs/steal-tools) and I’ll take a look.

---

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [November 26, 2016, 6:09pm UTC](https://forums.bitovi.com/t/traceurruntime-is-not-defined/448/8 "2016-11-26T18:09:43Z")

</div>

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!
