# \[SOLVED\] Aurelia & Webpack: "Unable to find module with id"

**URL:** <https://discourse.aurelia.io/t/solved-aurelia-webpack-unable-to-find-module-with-id/3662>\
**Category:** Help Requests\
**Created:** [July 20, 2020, 2:17pm UTC](https://discourse.aurelia.io/t/solved-aurelia-webpack-unable-to-find-module-with-id/3662 "2020-07-20T14:17:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roddharris](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/roddharris/32/1340_2.png) [@roddharris](https://discourse.aurelia.io/u/roddharris)\
**Post date:** [July 20, 2020, 2:17pm UTC](https://discourse.aurelia.io/t/solved-aurelia-webpack-unable-to-find-module-with-id/3662/1 "2020-07-20T14:17:37Z")

</div>

I’ve seen a number of issues posted here with a similar topic. Most of the suggestions talk about the need for `PLATFORM.moduleName()` – which I’ve tried with no success.

I have a View Model that displays a number of different dialogs (approx 6 different dialogs). All of the dialogs work during dev. However, once I build and release to production – **one dialog no longer works** but gives the following error:

> Error: Unable to find module with ID: 9yG/.html

**sessions.ts - original code**

```ts
import {Dialog1} from './dialog1'
import {Dialog2} from './dialog2'

export class SessionJurors {
   ...

   displayDialog1(){ //<== Non working dialog
      this.dialogService.open({viewModel: Dialog1, model: this.sessionPK})
       ...
   }

   displayDialog2(){ //<== Working dialog
      this.dialogService.open({viewModel: Dialog2, model: this.sessionPK})
     ...
   }
}

```

Based on other posts, I tried adding the following to the top of sessions.ts.

**UPDATE: Ultimately, this is what solved my issue. However, be sure to refresh your client cache so that you actually see the changes reflected in production**

```ts
PLATFORM.moduleName("./dialog1")

```

That didn’t help so I tried something else I saw posted. I added the following to dialog1.ts

**dialog1.ts**

```ts
@useView('./dialog1.html') //<-- Added this
export class Dialog1{
   ...
}

```

I now get the first error along with an additional error:

> Failed to load resource: the server responded with a status of 404 (Not Found)

Where am I going wrong with this? Thanks for any help!

---

<div class="post-metadata">

**Author:** ![zewa666](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/zewa666/32/19_2.png) [@zewa666](https://discourse.aurelia.io/u/zewa666)\
**Post date:** [July 20, 2020, 5:43pm UTC](https://discourse.aurelia.io/t/solved-aurelia-webpack-unable-to-find-module-with-id/3662/2 "2020-07-20T17:43:48Z")

</div>

Does this one perhaps help? Seems to be a similar issue [(Solved) Error: Cannot determine default view strategy for object](https://discourse.aurelia.io/t/solved-error-cannot-determine-default-view-strategy-for-object/3589)

---

<div class="post-metadata">

**Author:** ![roddharris](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/roddharris/32/1340_2.png) [@roddharris](https://discourse.aurelia.io/u/roddharris)\
**Post date:** [July 20, 2020, 7:17pm UTC](https://discourse.aurelia.io/t/solved-aurelia-webpack-unable-to-find-module-with-id/3662/3 "2020-07-20T19:17:43Z")

</div>

Thanks. As you can see from my original post, I had already tried that (i.e. adding `PLATFORM.moduleName('./dialog1')`

However, I realized I was running into a caching issue. I made the change and copied it to the server. But, production builds with webpack (at least in my case) re-use the same chunk names. Those items were already cached so I wasn’t actually hitting my new instance of the code.
