stylify / packages

💎 Monorepository for Stylify packages. Stylify uses CSS-like selectors to generate Extremely optimized utility-first CSS dynamically based on what you write 💎.
https://stylifycss.com
MIT License
424 stars 9 forks source link

I can't use Stylify on Astro #209

Closed mzaini30 closed 1 year ago

mzaini30 commented 1 year ago

Describe the bug

I can't use Stylify on my Astro minimal template. Why?

Reproduction

https://github.com/mzaini30/astro-stylify

Logs

Error: Cannot find module 'C:latihanastro-stylifysrcstylesstylify.css' imported from 'astro:scripts/page-ssr.js'
    at nodeImport (file:///C:/latihan/astro-stylify/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:52451:25)
    at ssrImport (file:///C:/latihan/astro-stylify/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:52374:20)
    at eval (astro:scripts/page-ssr.js:3:50)    at instantiateModule (file:///C:/latihan/astro-stylify/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:52420:15)

System Info

OS: Windows 11 (Phoenix Lite OS)

Text editor: VS Code

Terminal: Git Bash
Machy8 commented 1 year ago

I have forked your repository https://stackblitz.com/edit/github-a3hjjs?file=package.json,astro.config.mjs,server.mjs

Could you please download it and test if something wasn't missing for example? If this example works? In your repo, there were no build/dev commands.

Anyway, if it wont work on windows, I think, this C:latihanastro-stylifysrcstylesstylify.css will be the problem ...

mzaini30 commented 1 year ago
pnpm astro dev
pnpm astro build
mzaini30 commented 1 year ago

I want output static, not server

Machy8 commented 1 year ago

This actually seems weird, like some bug with Windows and Node.js path.join...

I will try to reproduce it on some of my Windows devices.

mzaini30 commented 1 year ago

I think the problem because I use Git Bash. In Windows Command Prompt or PowerShell, the path is using \. But, in Git Bash, the path is /

Machy8 commented 1 year ago

This should be solved automatically by path.join() by Node.js as it should use platform specific separators, that's why it is used for joining parts of paths. But in your case, it doesn't use any.

I have cloned your repo, it works fine on Linux and Mac.

I will have to check it out on Windows.

Thanks for the report!

mzaini30 commented 1 year ago

Yes, very difficult coding in Windows. I rewerite my packages after migration from Linux. Hehehehe..

Machy8 commented 1 year ago

Note&Tips for later readers:

Machy8 commented 1 year ago

@mzaini30 Hi, this should be fixed in the https://github.com/stylify/packages/releases/tag/v0.5.28 latest release. Could you please let me know, if it works?

Also, a configuration hot reload was added, so if you modify the config, the bundler should use the new configuration without the need of restarting Astro again.

Machy8 commented 1 year ago

@mzaini30 Could you please respond?

mzaini30 commented 1 year ago

Wait

mzaini30 commented 1 year ago

It works.... amazing

gambar

gambar

mzaini30 commented 1 year ago

Sorry for waiting long

Machy8 commented 1 year ago

Good, thanks! Closing. In case you find any other bug, please create a new issue :).