portabletext / svelte-portabletext

Transform Portable Text content into Svelte components
svelte-portabletext.sanity.build
MIT License
61 stars 18 forks source link

Unknown file extension ".svelte" for /node_modules/@portabletext/svelte/PortableText.svelte #28

Open MathiasWP opened 1 year ago

MathiasWP commented 1 year ago

When used in a Sveltekit project

emilaleksanteri commented 9 months ago

I get the same issue after I updated my repo from svelte 3 to 4 when running a testing-library/svelte test in vitest on my svelte portable text components

emilaleksanteri commented 9 months ago

When used in a Sveltekit project

Have you managed to overcome this issue btw?

MathiasWP commented 9 months ago

When used in a Sveltekit project

Have you managed to overcome this issue btw?

I haven't tried since i created this issue. I forked the repo, made some changes to the codebase, and copied it over to our project.

emilaleksanteri commented 9 months ago

When used in a Sveltekit project

Have you managed to overcome this issue btw?

I haven't tried since i created this issue. I forked the repo, made some changes to the codebase, and copied it over to our project.

Is it sensitive information to share or can you tell which parts were broken in the library for you?

MathiasWP commented 9 months ago

When used in a Sveltekit project

Have you managed to overcome this issue btw?

I haven't tried since i created this issue. I forked the repo, made some changes to the codebase, and copied it over to our project.

Is it sensitive information to share or can you tell which parts were broken in the library for you?

No parts were broken, but when copying over the code our TypeScript started screaming at our editor. So i mostly fixed the TypeScript types

emilaleksanteri commented 9 months ago

When used in a Sveltekit project

Have you managed to overcome this issue btw?

I haven't tried since i created this issue. I forked the repo, made some changes to the codebase, and copied it over to our project.

Is it sensitive information to share or can you tell which parts were broken in the library for you?

No parts were broken, but when copying over the code our TypeScript started screaming at our editor. So i mostly fixed the TypeScript types

Oh okay sounds good, I'll do the same then haha thank u!

atu-record commented 6 months ago

i had this issue only occur when developing in a monorepo. outside the monorepo it works properly

edit: during monorepo development adding ssr: { noExternal: ['@portabletext/svelte'] } to viteconfig supressed the issue for us as a workaround. hope this helps someone

cast-iron-developer commented 4 months ago

I was able to solve this issue by just adding: export const ssr = false; to my +page.server.js file for the respective +page.svelte file that was displaying this issue.