Closed Sparkmasterflex closed 4 months ago
Please share a repository that reproduces the issue.
I'm currently seeing it on a company repo that I can't share but in the AM I'll make a public repo and try to reproduce there.
Here's the repo. I confirmed that with the setup if I run npm run build
it gives me that error as I'm seeing in my other repo
https://github.com/Sparkmasterflex/stylex-theme-issue
also if you change this key/value from a function to normal object and adjust usage accordingly it'll also error out on the same error.
Ok it seems like either the plugin or stylex aren't handling the aliases the right way. I'm going to check what can be done from my side.
We've been developing with this plugin, vite, react and stylex for a few weeks and basically only using storybook for development. Now we're at the point where we're configuring our project to be published as a package and when we run
vite build
we get the errorOnly static values are allowed inside of a stylex.create() call
The workaround we found for places where it's actually pointing to
stylex.create({})
was to just make everything a function.This is a bit annoying but NBD. The problem that we can't work around is that it gets upset with this same error when we call
stylex.createTheme()
and there's little to go on for tracking down a workaround or the actual issue.theme.ts
We've tried doing string values for
default
s but same issue.vite.config.ts
package versions