-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: v6, describe how to account for es modules in project #24026
Comments
Thanks for the issue! This issue has been labeled as Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed. If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue. For a guide on how to create a good reproduction, see our Contributing Guide. |
I'm also seeing this issue. @liamdebeasi I've put together a reproduction. To see the error, run Stack track for error when running
The source of the error seems to be in |
Ionic 6 will be using ES Modules, and it looks like Next.js still has a few issues with supporting ES Modules: https://github.com/vercel/next.js/issues?q=is%3Aissue+is%3Aopen+Unexpected+token+%27export%27 As a temporary workaround, you can use https://www.npmjs.com/package/next-transpile-modules which is a Next.js plugin that will transpile ES Modules to Common JS (CJS). While we do not consider this a bug in Ionic, we are still discussing the best path forward in terms of documentation and migration guides. I will update this thread when I have more to share. Thanks! |
Actually there are 2 issues here, 1 Ionic and 1 non-Ionic. The Ionic issue is that the custom elements generated directly reference |
Thank you, transpiring the Ionic/Stencil modules looks like a promising and reasonable solution, once the Stencil bug is fixed. |
Hi everyone, A couple updates here:
I am going to close this issue out as the main work required to get this issue resolved has been completed. Keep an eye out for the full migration guide as it will detail other breaking changes in Ionic 6. Thanks! Jest MigrationIonic 6 now ships as ES Modules. ES Modules are supported in all major browsers and bring developer experience and code maintenance improvements. Developers testing with Jest will need to update their Jest configuration as Jest does not have full support for ES Modules as of Jest 27. This update involves using Babel to compile Ionic's ES Modules down to the CommonJS (CJS) format, a format that Jest can understand. Once Jest ships support for ES Modules, this change will no longer be necessary. See jestjs/jest#9430 for updates on ES Modules support in Jest. If you are starting fresh with a new Ionic app, this configuration is done for you in our starter applications. For those with existing Ionic apps, follow the steps below to get Jest working with Ionic 6. Ionic Vue
Ionic ReactFor developers using Create React App (CRA), there is currently no way to update the
|
- See recommendation in ionic-team/ionic-framework#24026 (comment)
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
When using next-build with ionic/core
I get this error with beta 6 version 6 or greater
Expected Behavior
Would build like it does with beta 6 version 5
Steps to Reproduce
run next build with ionic beta 6 version 6 or great with ionic/core
Code Reproduction URL
No response
Ionic Info
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: