-
-
Notifications
You must be signed in to change notification settings - Fork 835
bug: can't get experimentalImportInjection to work with vite #3407
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
2.16.1
Current Behavior
Dynamic import failure on vite/rollup still persists.
Expected Behavior
Rebuilding with latest experimentalImportInjection should solve dynamic import failure on vite/rollup.
Steps to Reproduce
- Visit this codesandbox: https://codesandbox.io/s/priceless-mcclintock-2x9n30
OR
git clone git@github.com:hirosystems/create-stacks.gitcd templates/template-vuenpm install @stacks/connect@5.0.6-alpha.6be82fd.0 @stacks/connect-ui@5.0.6-alpha.6be82fd.0npm start
- click
Connect Walletbutton - → dynamic import fails, as previously
Background
We have a fairly stock vue+vite sample projects in: https://github.com/hirosystems/create-stacks/tree/main/templates/template-vue → used for codesandbox
The stencil component was updated to experimentalImportInjection under 2.16.1. The component was rebuilt and released via npm as @stacks/connect-ui@5.0.6-alpha.6be82fd.0.
CC @rwaskiewicz #2827 (comment)
Code Reproduction URL
https://codesandbox.io/s/priceless-mcclintock-2x9n30
Additional Information
Is it possible to fix this issue with the @rollup/plugin-dynamic-import-vars plugin? If so how?
I've tried similar things to the following:
dynamicImportVars({
include: "./node_modules/@stacks/connect-ui/dist/connect-ui/*",
}),Where connect-ui is a stencil component via plain dist, but used via another dependency (connect).