-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dialog does not open when webpack bundle is built in production mode #361
Comments
For this to work you will either need to pass the |
@useview('dialog/dialog.html') on dialog ViewModel fixes the problem, I it would be great to understand how production mode affects the runtime. |
|
|
Finally we figured a root cause - webpack in production mode does Module Concatenation (ModuleConcatenationPlugin enabled in production mode by default) which makes view model inlined into the class that uses it (If you refer to the same VM in multiple places it wouldn't happen).
Aurelia Webpack Plugin, we suppose, should somehow prevent inlining, like what it does when it processes Platform.moduleName'd module ref. |
I just stumbled across this issue a few moment ago. The application I am working on is a mixed JS and TS. I have only noticed this problem occurring on view models which are typescript files. JS file seem to work just fine. Hopefully, that sheds some light on this issue |
@ggayowsky can you give this comment (a the comments after it as well, there's extra example) a look https://discourse.aurelia.io/t/production-build-issue/3774/3 and see if it's somewhat matches your scenario. An explanation in our Discord chat at https://discord.com/channels/448698263508615178/448699089513611266/755368450058092555
|
I'm submitting a bug report
We were very excited with the news that there is no more need to PLATFORM.moduleName dialog view models, so we decided to give it a try.
https://aurelia.io/blog/2018/09/06/aurelia-release-notes-early-september-2018
We removed all dialog VMs PLATFORM.moduleName() statements in our codebase, and were very happy to see dialogs working when we run app in webpack development mode. Unfortunately, the behavior is different in production mode. We prepared a repo based on Aurelia CLI app template that reproduces and issue.
2.0.0-rc.3
Please tell us about your environment:
Operating System:
OSX 10.13.6
Node Version:
v10.6.0
NPM Version:
6.4.0
JSPM OR Webpack AND Version
webpack 4.16.4
Browser:
Chrome 68
Language:
TypeScript 2.9
Current behavior:
If i build a bundle with mode: "production" I am getting the following error on dialog opening.
in development mode dialog does open with no errors
I was able to reproduce the issue for the clean Aurelia App template (created using latest AURELIA CLI)
https://github.com/shabalin/aurelia-dialog-issue-361
The text was updated successfully, but these errors were encountered: