Open flayks opened 3 years ago
Hey @flayks, nice catch!
I was able to reproduce on my end with Snowpack 3, not sure what could cause that though, perhaps because the package is built with webpack?
@lihbr not quite sure, maybe it needs to be exported as a ES module?
More generally the plugin doesn't seem to be compatible with an ESM environment, as using it with SvelteKit, I got imports errors from Vite:
TypeError: Cannot destructure property 'RichText' of '__vite_ssr_import_2__.default' as it is undefined.
Any solutions to that?
Hey @flayks, I'm really sorry we didn't manage to make progress on that one since January.
Are you still able to use the prismic-dom
package without destructuring it though?
We should be reworking those helpers pretty soon, changing their bundler also :)
cc @samlfair
No worries. Since SvelteKit went with Vite, unfortunately no, it is not really working as it. Oh ok, cool! That would be nice.
Hey, sorry for the late notice: we've been making great progress on revamping our kits!
I think you'd be interested to give a try to @prismicio/helpers@alpha
, our revamp of prismic-dom
which should allow proper import of everything ☺️
I know we also have an example of using Prismic x Svelte on the way with our new kits, cc @priyaprafful
When trying to destructure PrismicDOM like that:
I get this error:
Using Snowpack 3