Bundle a donejs app as static

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.

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

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

Here’s an excerpt from my form stache:

<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.

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

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

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

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

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.

<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.

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

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

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

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