-
Notifications
You must be signed in to change notification settings - Fork 12k
When serving es5 ngx-socket-io gives me error #18284
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
Comments
It is normal for ngcc to process the ES2015 version of the library. The ES5 version of the application is created at the end of the build by downleveling the ES2015 version of the app. So the order of things is that your TS code is compiled by Angular/TypeScript, webpack bundles this with the imported 3rd party libraries into ES2015 formatted distributable files, these ES2015 files are downleveled to ES5. Now I believe that your index.html should be setup to use the ES5 dist files on older browsers, and ES2015 otherwise. Can you see if ES5 versions are being built if you run |
@petebacondarwin |
@petebacondarwin I get on a latest firefox on my mac (not ipad this time) this error
after few problems I've managed to make it working back as |
I wonder if there is some additional setup that is needed... Perhaps in the |
@petebacondarwin adding safari 9 to the browserslist doesn't really change something. I'm stuck.
then
|
…ndor files This change prevents import statements from being added to commonjs files when downleveling helpers are needed. These imports would then cause webpack to assume that the file is an ES module and potentially break the commonjs file. Fixes angular#18284
@clydin Just compiled angular-cli with your modification an looks like it's working now. Thanks a lot. Is it possible having a more in depth explanation. |
…ndor files This change prevents import statements from being added to commonjs files when downleveling helpers are needed. These imports would then cause webpack to assume that the file is an ES module and potentially break the commonjs file. Fixes #18284
…ndor files This change prevents import statements from being added to commonjs files when downleveling helpers are needed. These imports would then cause webpack to assume that the file is an ES module and potentially break the commonjs file. Fixes #18284
Angular CLI 10.0 will now down-level vendor files when targeting ES5 within the application's TypeScript configuration. Vendor files were previously only down-leveled as a side effect of using differential loading which down-leveled the entire application as a post-processing step. |
@clydin Many thanks |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Is this a regression?
From what I remember it didn't worked with angular 9 either
Description
.I'm using an old IPad 2 for development and just upgraded to angular 10. I'm using ngx-socket-io but I'm trying to build the project using
es5
. I followed the guideline for building es5 from hereI notice that angular is using even in es5 the bundle fesm2015 of ngx-socket-io causing this unknown error.
When running ng serve it says
compiling ngx-socket-io : es2015 as esm2015
I needed to use old safari in order to get the debugger working, so finding the precise error is kind of painful.
notice that basic app using
ng new projectName
is working on my ipad.I use this command
ng serve --aot --configuration es5 --host 192.168.XX.XX
this is my first GitHub Bug report please let me know if I'm doing wrong or at the wrong place
Thanks in advance
🔬 Minimal Reproduction
I wasn't able to reproduce it on stackBlitz but basically you only have to install ngx-socket-io import it on your new project and make ng serve with host value for safari 9
-->
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: