Closed dhutaryan closed 8 months ago
The plugin is only offered in ESM format, the error you got actually mentions it and the link points to a few suggestions on how to fix it (switch your vite config file from CJS to ESM).
You could also await import('vite-plugin-stylex')
by making the defineConfig async:
export default defineConfig(async () => {
const styleX = await import('vite-plugin-stylex');
return {
plugins: [
...
styleX(),
],
}
})
My recommendation: change the config file to be an ESM module (Vite deprecated CJS on v5, so I guess they'll drop support for CJS in the future).
I installed the plugin but it doesn't work at all.
I have an error while importing:
Then I have error if I try to serve the project.
I use
nx
. Maybe there are some specifics with that. I'm now sure.