HorusGoul / vite-plugin-stylex

Vite Plugin for StyleX
MIT License
119 stars 13 forks source link

it seems plugin does not work correctly in qwik #35

Closed dulee-dev closed 1 week ago

dulee-dev commented 9 months ago

I follow your direction with new qwik-city-app

  1. npm craete qwik
  2. npm install --save-dev vite-plugin-stylex
  3. npm install --save @stylexjs/stylex
  4. add the plugin to vite config
  5. open src/global.css and add "@stylex stylesheet;"
  6. and try stylex in src/routes/index.tsx

but style is not applied

it seems the value of props are broken

Screenshot 2024-01-22 at 2 00 53 AM Screenshot 2024-01-22 at 2 00 45 AM

and my vscode show error when i import "vite-plugin-stylex" (but no error in compile)

Screenshot 2024-01-22 at 1 55 16 AM

thank you for your efforts

neotheprogramist commented 8 months ago

bump! I have the same issue in vite.config.ts

dulee-dev commented 8 months ago

i use pandacss now and very happy with it 😄

HorusGoul commented 8 months ago

Please share a repository that reproduces the issue.

ziimakc commented 8 months ago

Same issue. Problem with types it seems because package.json missing

  "main": "./dist/index.mjs",
  "types": "./dist/index.ts",

You can try import import styleX from "vite-plugin-stylex/dist/index.mjs";, but it just produces other issues

HorusGoul commented 1 week ago

The plugin is an ESM package; you'll need to fix that on your end by using the .mts extension for your vite config for example as I don't plan to support CJS builds. I'm closing this one.