mayank99 / ecsstatic

the predefinite CSS-in-JS library for vite
https://ecsstatic.dev
Other
273 stars 8 forks source link

Vite error with CJS project #15

Closed leaysgur closed 9 months ago

leaysgur commented 1 year ago

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined

How to reproduce

Work around

(Aside from that, I really favored the minimalist design. Thanks for a great library! 👏🏻 )

mayank99 commented 1 year ago

Hey @leader22, thanks for the issue.

I fixed the error you're getting but then I ended up with another error :/

[plugin:ecsstatic] (0 , import_esbuild_plugin_noexternal.default) is not a function
/home/projects/github-a3inbg/src/Logo.tsx
    at inlineVarsUsingEsbuild (file:///home/projects/github-a3inbg/node_modules/@acab/ecsstatic/vite.cjs:245:52)

This is a bit puzzling. I'll investigate further when I have some more time.

sandbox 1: https://stackblitz.com/edit/github-a3inbg sandbox 2: https://stackblitz.com/edit/github-huj6rz

leaysgur commented 1 year ago

Thanks for taking a quick look!

This is a bit puzzling. I'll investigate further when I have some more time.

Yeah, it's a tricky problem, I'm sorry that I could not be of help. 😅

mayank99 commented 9 months ago

I've decided to remove CJS support altogether. It's not worth supporting it in 2024. Vite has also deprecated its CJS support, so everyone needs to migrate to ESM anyway.