Closed wireless25 closed 8 months ago
Hi there, since it's been a while, is there any update on this issue? Were you able to reproduce it? I am happy to add missing information if needed.
Hi @wireless25 I was able to reproduce it. Thanks for providing all the details including a temporary work-around to help us investigate it.
It seems Vite's virtual module convention does not fully work to import modules in JS. I'll investigate more if it can only be detected after the page is loaded.
Hey @schabibi1 thx for your reply and the investigation. I am very curious what you will find out.
Hi @wireless25
I investigated, but what we followed on the docs on Vite to force importing the virtual module and its values are not working as they should be. We’ll keep monitoring if there will be an update from the Vite side, and for now, we recommend going with hoisting deps publicly in .npmrc as pnpm suggests on their docs as you found it worked.
I'll close this issue temporary as there is a workqround. But feel free to re-open this issue if the workaround won't work. Or I'll re-open this issue when I find a better solution.
Expected Behavior
When
pnpm
is used as package manager storyblok-astro works without additional configurationCurrent Behavior
When
pnpm
is used to install dependencies the package@storyblok/js
can not be properly resolved by rollup. I get the following vite error when building:This happened in my project. To verify it is not a local problem I tried the same with the project you provide on Stackblick.
Steps to Reproduce
It is possible to overcome this issue by manually hoisting the storyblok dependencies publicly. In .npmrc it could look like this:
This is a good workaround, but not straightforward. It would be great if
storyblok-astro
would work without hoisting the dependencies manually.