qwik-ui icon indicating copy to clipboard operation
qwik-ui copied to clipboard

Rendering components from /packages in SSR

Open TheMcnafaha opened this issue 1 year ago • 0 comments

From @maiieul (edited to remove discord especifics and use Github markdown):

Code like this currently doesn't work in SSR

import AccordionCode from '../../../../../../../../packages/kit-fluffy/src/components/accordion/accordion?raw'

?raw works out of the box in a simple Qwik/Vite project, and it does work in development with nx, but in preview/SSR it says that /accordion doesn't export default...

I tried with import.meta.glob but it's almost the same: dev works and SSR imports an empty string...

It should also be noted that if the file is copied to be in src, the problem goes away. The current plan to solve this would be to copy the directory packakes/[component name] inside each component that needs to access the code, most likely done with a custom script.

TheMcnafaha avatar Jan 12 '24 21:01 TheMcnafaha