I have built my application and then deployed it to S3. The application works fine until I perform an operation that uses the aurelia dialogs. The error I get is
I guess you are using webpack, and use the dialog open API in the following way:
import { SomeDialogViewModel } from './some-module';
export class SomeCustomElement {
// ...
confirm() {
dialogService.open({
viewModel: SomeDialogViewModel
})
}
}
if so:
Why the error happens at production time, but not during development is because in development build, modules origins (can be understood as module path) are preserved, so aurelia-webpack-loader is able to figure out the origin of dialog view model module, and so is corresponding view. In production build there are some more work related to module mangling in webpack that makes aurelia-webpack-loader no longer able to figure out the view model origin.
You have 2 options:
Instruction Webpack to not concatenate the module, via PLATFORM.moduleName: