# Verfügbarkeit von Discourse-Common-Assets: Unterschied zwischen Entwicklung und Produktion?

**URL:** <https://meta.discourse.org/t/discourse-common-asset-availability-difference-between-development-and-production/107490>\
**Category:** Development\
**Created:** [25. Januar 2019 um 02:37 UTC](https://meta.discourse.org/t/discourse-common-asset-availability-difference-between-development-and-production/107490 "2019-01-25T02:37:42Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [25. Januar 2019 um 02:37 UTC](https://meta.discourse.org/t/discourse-common-asset-availability-difference-between-development-and-production/107490/1 "2019-01-25T02:37:42Z")

</div>

I’m adapting the [locations plugin](https://meta.discourse.org/t/locations-plugin/69742) to work better within the context of the [custom wizard plugin](https://meta.discourse.org/t/custom-wizard-plugin/73345).

The locations plugin has a component called [`location-selector`](https://github.com/angusmcleod/discourse-locations/blob/master/assets/javascripts/discourse/components/location-selector.js.es6), which is essentially an autocomplete input for geocoding locations. It uses the Discourse autocomplete jQuery plugin, which requires a raw template.

As the raw templating system is not available in the wizard app (e.g. the `Discourse.RAW_TEMPLATES` constant is not pre-loaded), and I want this component to work across both apps, I’ve assigned the raw template to a constant in the component file and used the various `RawHandlebars` methods in `discourse-common/lib/raw-handlebars`, e.g.

```plaintext
import RawHandlebars from 'discourse-common/lib/raw-handlebars';

const autocompleteTemplate = "<div class='autocomplete'><ul>{{#each options as |o|}}{{#if o.no_results}}<div class='no-results'>{{i18n 'location.geo.no_results'}}</div>{{else}}{{#if o.provider}} <label>{{{i18n 'location.geo.desc' provider=o.provider}}}</label> {{else}} <li class='ac-form-result'><label>{{geo-location-format o geoAttrs=o.geoAttrs}}</label> {{#if o.showType}} {{#if o.type}} <div class='ac-type'> {{o.type}} </div> {{/if}} {{/if}} </li> {{/if}} {{/if}} {{/each}} </ul></div>";
...

this.$().val(val).autocomplete({
   template: RawHandlebars.compile(autocompleteTemplate),
...

```

This works fine in development (in both normal Discourse and the Wizard app), however it fails in production in the normal Discourse app with

```plaintext
n.default.compile is not a function

```

(you can see this error currently [here](https://discourse.angusmcleod.com.au/c/locations) if you compose a post and click “Add Location”). Note, importing specific functions (e.g. ‘compile’) doesn’t fix it.

For some reason, `discourse-common/lib/raw-handlebars` is not loaded or required the same in production as it is in development.

I’m sure there’s an obvious reason why this is not working in production, but I’m just not seeing it at the moment. Any ideas welcome.

---

_[View the full topic](https://meta.discourse.org/t/discourse-common-asset-availability-difference-between-development-and-production/107490)._
