-
Notifications
You must be signed in to change notification settings - Fork 216
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
ASP.NET Core 2.0 + Angular 5 App with Kendo components failed when published to production with SSR and AoT enabled #1210
Comments
It looks like the SSR implementation uses the "module" entry point, but attempts to execute the code in NodeJS. This will not work unless the application code is first bundled through Webpack or Rollup. Babel can also be used, but technically the code doesn't need transpilation, just different module syntax. I'm not sure what we could do to rectify this. The packages already have a "main" entry point with the correct module type for NodeJS, as per the CommonJS specification. This code doesn't seem to be used in this case. |
Thanks for the explanation. Is there any way to force Angular CLI to use correct module entry point? |
Updates
Workaround
|
Thanks @tsvetomir for the investigation. Based on comments, it seems that this related to how we publish the NPM package. See the explanations by Toxicable. He has shared this doc which will be helpful to fix the issue. |
Thanks for sharing 👍 The most likely reason why this is not an issue with the We would've considered them as a possible solution, but there is some controversy on whether they're a good choice going forward. In any case, our current packaging should also work provided the SSR implementation picks up the right entry point. |
Managed to solve this by changing the package structure. All latest package versions include the fix. |
Awesome! Thanks @tsvetomir 👍 |
I'm submitting a...
Current behavior
We have upgraded our existing angular 4.x.x project to angular 5.x. As a part of that, we have migrated to latest Asp.net project template too (which is based on angular CLI).
even though everything works fine in the development environment, @progress packages giving 'Unexpected token import' error when it published to production.
Workaround
Follow instructions here and compile js files into es2015
Environment
Package versions:
The text was updated successfully, but these errors were encountered: