Skip to content

bug: can't get experimentalImportInjection to work with vite #3407

@janniks

Description

@janniks

Prerequisites

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

OR

  • git clone git@github.com:hirosystems/create-stacks.git
  • cd templates/template-vue
  • npm install @stacks/connect@5.0.6-alpha.6be82fd.0 @stacks/connect-ui@5.0.6-alpha.6be82fd.0
  • npm start

  • click Connect Wallet button
  • → 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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions