# Production build issue

**URL:** <https://discourse.aurelia.io/t/production-build-issue/3774>\
**Category:** Help Requests\
**Created:** [September 12, 2020, 2:12pm UTC](https://discourse.aurelia.io/t/production-build-issue/3774 "2020-09-12T14:12:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbockle](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jbockle/32/607_2.png) [@jbockle](https://discourse.aurelia.io/u/jbockle)\
**Post date:** [September 12, 2020, 2:12pm UTC](https://discourse.aurelia.io/t/production-build-issue/3774/1 "2020-09-12T14:12:17Z")

</div>

I’m having a very strange issue…in my production build if I exclude devtool or set it to false, or use the default value from aurelia-cli, there seems to be some side effects-after selecting a dropdown in the examples page, required views are not rendering properly.

The only thing that works for me so far is to use the development value for (see [commit](https://github.com/jbockle/aujsf-site/commit/378ef0e1feae75f01906ea6c1e608ac52fb25442)) devtool for production. The fix is deployed [here](https://aujsf.jbockle.dev/#/examples).

To test this issue locally, I have `http-server` installed. After `npm run build` I open a cli in dist folder and running `http-server` and I get the same result as I do when deployed.

Has anyone experienced this or have suggestions?

---

<div class="post-metadata">

**Author:** ![jbockle](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jbockle/32/607_2.png) [@jbockle](https://discourse.aurelia.io/u/jbockle)\
**Post date:** [September 13, 2020, 11:12am UTC](https://discourse.aurelia.io/t/production-build-issue/3774/2 "2020-09-13T11:12:34Z")

</div>

I resolved this, some of my plugins custom elements were missing `@customElement(name)` and aurelia wasn’t able to find the element after webpack’s production mode minification & obfuscation.

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [September 13, 2020, 1:29pm UTC](https://discourse.aurelia.io/t/production-build-issue/3774/3 "2020-09-13T13:29:12Z")

</div>

Arr, nice to hear that. So i guess you use static resources registration API? If so, yes webpack may have issues. Also in the original post, there was no error message and also you mentioned aurelia cli, i thought you used our built in bundler.

Note to self: document the issue of static api with webpack… while documenting the api itself.

---

<div class="post-metadata">

**Author:** ![jbockle](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jbockle/32/607_2.png) [@jbockle](https://discourse.aurelia.io/u/jbockle)\
**Post date:** [September 14, 2020, 12:38am UTC](https://discourse.aurelia.io/t/production-build-issue/3774/4 "2020-09-14T00:38:50Z")

</div>

I didn’t see any errors before, the `aujsf-slot` element wasn’t running lifecycle hooks so I just happened to look at it and notice it didn’t have the decorator. I’m not sure if I am using static resources registration api, is that FrameworkConfiguration.globalResources?

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [September 14, 2020, 12:44am UTC](https://discourse.aurelia.io/t/production-build-issue/3774/5 "2020-09-14T00:44:40Z")

</div>

dynamic resources:

```auto
configuration.globalResources([
  'resource-module-1',
  'resource-module-2',
])

```

static resources:

```auto
configuration.globalResources([
  MyResourceConstructor1,
  MyResourceConstructor2,
])

```

static as in statically analysable or no need to load a module by its name first, and look into it.

---

<div class="post-metadata">

**Author:** ![jbockle](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jbockle/32/607_2.png) [@jbockle](https://discourse.aurelia.io/u/jbockle)\
**Post date:** [September 14, 2020, 2:40am UTC](https://discourse.aurelia.io/t/production-build-issue/3774/6 "2020-09-14T02:40:30Z")

</div>

ahh yes I am using static resources then, good to know. I don’t recall where I read this, but it was recommended to use the decorator when writing plugins instead of relying on convention so I did use it in most places, just a few were missed. thanks for the help as always 🙂
