-
Notifications
You must be signed in to change notification settings - Fork 787
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
Dynamic import not statically analyzable breaks tools like vite #2827
Comments
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out. Thank you for using Stencil! |
Reopening. Most of theses kinds of issues should be resolved by using custom elements directly and not relying on Stencil lazy loading. Work is already underway to provide full support for this and we will be sharing more soon. Thanks! |
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out. Thank you for using Stencil! |
@stencil/core version: 2.5.2,
This issue exists with latest versions of vite and rollup. In other words do not build with anything except webpack. |
Actually this is a problem with ionic, not vite/rollup |
I mean stencil |
Thats exactly what I'm saying: ionic-vue do not compile/build corretly in vite (esbuild) nor rollup. |
The whole point of this issue is in fact to make stencil compatible with other dev/build tools (namely vite and rollup) so that we can use vite + ionic. |
@liamdebeasi are you saying that there is a workaround for this ? could you please explain it ? currently a single component made with Stencil blocks me from using a new build system. Thank you |
For developers using Stencil directly, you can output your components using the Custom Elements Bundle: https://stenciljs.com/docs/custom-elements. This approach does not use lazy loading which should help with static analysis in Vite. For developers using Ionic Framework, we do have plans to use this custom elements output, but we will be doing that (at least for Vue initially) in Framework v6. |
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out. Thank you for using Stencil! |
Is there any demo repo for stencil with esbuild? |
👋 This issue has been fixed with the v2.16.0 release of Stencil. As a result, I'm going to close this issue. If you believe that the bug still exists, please feel free to open a new ticket. Thanks again! EDIT: This functionality is gated under a new flag, experimentalimportinjection. Folks wishing to make use of the functionality should enable this flag and recompile their Stencil projects. |
@rwaskiewicz do the next version of ionic will be built with the flag? |
We will be incorporating these changes into an upcoming release of Ionic. Please follow ionic-team/ionic-framework#23823 for updates. |
Only one I can find is the repro example created by the author of this issue: https://github.com/remorses/stencil-reproduce-2827 I cloned that and updated Stencil to 2.16 and esbuild to 0.14.43 and it no longer issues the warning, so it appears to be working with the update :) |
I still have the same problem using a design system library based on Stencil 2.16.1... 😥 |
@splanard can you please create a new issue with a minimal reproduction case please? |
I also have problem with Vite and Stencil 2.17.1 One of the teams trying to move Angular 17 to Vite so they informed me about the issue. I checked with simple Angular 17 and it's working But with Vite + Solidjs it does not And I realy don't now what to do with it. Angular 17 don't have access to customize Vite config to do copy or something |
At this time, Stencil v2 is no longer supported. I suggest upgrading to Stencil v4 if possible, which has the latest + greatest updates/support for Vite. Otherwise, you may be able to see if If the issue still persists with Stencil v4 and |
@rwaskiewicz
I tried with and without |
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
The following code relies on webpack specific import behaviour, other tools like vite and esbuild won't work because the import path is not statically analyzable without evaluating the expression
stencil/src/client/client-load-module.ts
Line 23 in cfd5d39
Expected behavior:
Import calls should be statically analyzable, replace
loadModule()
with a directimport()
callSteps to reproduce:
https://github.com/haikyuu/vite-ionic
The same thing happens with esbuild, it isn't able to bundle the dynamic import and it will fail at runtime
https://github.com/remorses/stencil-reproduce-2827
Related code:
Other information:
The text was updated successfully, but these errors were encountered: