# Bundle a donejs app as static

**URL:** <https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314>\
**Category:** Uncategorized\
**Created:** [June 14, 2016, 2:18am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314 "2016-06-14T02:18:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared\_Stehler](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/jared_stehler/32/280_2.png) [@Jared\_Stehler](https://forums.bitovi.com/u/Jared_Stehler)\
**Post date:** [June 14, 2016, 2:18am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/1 "2016-06-14T02:18:53Z")

</div>

is there a way to bundle a donejs app as a completely static app? I don’t think I need any of the ssr stuff and don’t want to deploy a separate nodejs service, but seem to be running into trouble running my app from a static context.

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/donejs/original/1X/d27e762bfd7fcbd526188c94abfc51ca229afdc7.png)

For example, in this form which is bound to a model object, when I change any input values I see this error

```auto
Cannot use `in` operator to search for `attrName` in `attrValue`

```

Here’s an excerpt from my form stache:

```auto
<form class="form-horizontal col-sm-8" ($submit)="create(%event)">
  <div class="form-group">
    <label for="inputCustomerId" class="col-sm-2 control-label">Customer Id</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="inputCustomerId" placeholder="Customer Id" can-value="customerId">
    </div>
  </div>

```

and I’m running `donejs build` and have set my route nginx location to point at `production.html` as the index.

---

<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:** [June 14, 2016, 6:05am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/2 "2016-06-14T06:05:23Z")

</div>

Shouldn’t be a problem. Is your code running in strict mode?

---

<div class="post-metadata">

**Author:** ![Jared\_Stehler](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/jared_stehler/32/280_2.png) [@Jared\_Stehler](https://forums.bitovi.com/u/Jared_Stehler)\
**Post date:** [June 14, 2016, 11:03am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/3 "2016-06-14T11:03:16Z")

</div>

Does that mean sprinkling “use strict” at the top of all the functions, or are things different nowadays in ES6?

---

<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:** [June 14, 2016, 10:40pm UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/4 "2016-06-14T22:40:50Z")

</div>

I was thinking those would be errors only in strict mode, but they are errors no matter what.

Anyway you can create this in a JSBin so I can take a look: [http://justinbmeyer.jsbin.com/qovipi/3/edit?html,js,output](http://justinbmeyer.jsbin.com/qovipi/3/edit?html,js,output)

---

<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:** [June 14, 2016, 10:41pm UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/5 "2016-06-14T22:41:24Z")

</div>

btw, there’s a `development.html` generated when you create a new app. Does that error?

---

<div class="post-metadata">

**Author:** ![Jared\_Stehler](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/jared_stehler/32/280_2.png) [@Jared\_Stehler](https://forums.bitovi.com/u/Jared_Stehler)\
**Post date:** [June 15, 2016, 12:07am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/6 "2016-06-15T00:07:52Z")

</div>

Yes, it did turn out I was able to reproduce this in done-serve, even though I didn’t think it was happening before. I tried a bunch of things and was able to more or less get this working by prefixing all of the field names in the `can-value=""` attributes on the form elements of my component. I also added a wrapping model tag, but not sure if that helps at all.

```auto
<can-import from="webadmin/models/hostedservice" />

<hostedservice-model get="{service}">

	<form class="form-horizontal col-sm-8" ($submit)="create(%event)">
	  <div class="form-group">
	    <label for="inputCustomerId" class="col-sm-2 control-label">Customer Id</label>
	    <div class="col-sm-10">
	      <input type="text" class="form-control" id="inputCustomerId" placeholder="Customer Id" can-value="service.customerId">
	    </div>
	  </div>

```

when I don’t prefix, it does fill in the form values properly, but any changes in the form leads can/compute/read to attempt an `in` query on the raw string value.

---

<div class="post-metadata">

**Author:** ![Jared\_Stehler](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/jared_stehler/32/280_2.png) [@Jared\_Stehler](https://forums.bitovi.com/u/Jared_Stehler)\
**Post date:** [June 15, 2016, 12:08am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/7 "2016-06-15T00:08:33Z")

</div>

Here’s where I’m including the component, for reference:

```auto
{{#if editingService}}
{{#with editingService}}
	<hosted-service-edit 
		{(service)}="editingService"
		(close)="closeEdit()" />
{{/with}}
{{else}}

```

---

<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:** [June 15, 2016, 2:57am UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/8 "2016-06-15T02:57:39Z")

</div>

> [@Jared\_Stehler](#):
>
> refixing all of the field names in the can-value=“” attributes on the form elements of my component

sorry if I’m being dense, but what do you mean by that? Thanks!

---

<div class="post-metadata">

**Author:** ![Jared\_Stehler](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/jared_stehler/32/280_2.png) [@Jared\_Stehler](https://forums.bitovi.com/u/Jared_Stehler)\
**Post date:** [June 15, 2016, 12:49pm UTC](https://forums.bitovi.com/t/bundle-a-donejs-app-as-static/314/9 "2016-06-15T12:49:13Z")

</div>

sorry; changed `can-value="customerId"` to `can-value="service.customerId"`
