Anchor Tag in Aurelia Dialog Causes Stack Error


Ok, very strange error here. I have a dialog view that has information about a document. Description, file name, other meta data, etc. The dialog was causing a Maximum call stack size exceeded error. I figured I had a recursive issue during initialization or something but couldn’t find it. So I decided to just comment everything out on the view, get it to work, and then uncomment stuff until it failed again. It turns out it was an anchor tag that was causing the issue. The tag is unrelated to bindings, etc.

I can reproduce this on just a static view that is loaded with the aurelia-dialog component. It’s a simple dialog that does nothing except confirm the user wants to delete a document. I put an anchor tag around a random word in the view and got the exception again. I can create a dialog with a single word in the body and nothing else and it works, but if i put an anchor tag around the word, it fails.

Is anyone using aurelia-dialog? Is anyone getting this error?


Your issue is because of module exports renaming, which means your dialog view model is renamed to a. Similar issue raised here

To make it work, explicitly decorate your view model with @customElement('some-name')


Yeah we’ve seen it too!

Another workaround is to use PLATFORM.moduleName("path/to/modal"); in the view-model that uses the modal. But I like bigopon’s idea better - one fix for all uses of the modal.