Side point, genuinely excited for this project as soon as I heard about it from Theo.
The problem
I know this library is new and not all edge cases have been covered. However, I am trying to use styleX within a pnpm package. Is this a covered use case or a future one? 🤔
I have two pnpm repos that I've tried this with:
- a project I'm working on and sadly it's too complex to come up with a simple repo to showcase. But when I instantiate styles.create and build the package, I get the following error:
Error: Unsupported Server Component type: undefined
Without using stylex, the component builds correctly and is able to be imported by the nextjs app just fine.
- I'm cloning create-t3-turbo (for a basic pnpm setup) and removing many unused things just to get it working to show the issue.
When I launch nextjs:
../../packages/ui/src/button/button.tsx:21:6
Syntax error: Unexpected token, expected ","
19 | return (
20 | <button
> 21 | {...stylex.props(styles.base)}
| ^
22 | onClick={() => alert(`Hello from your ${appName} app!`)}
23 | >
24 | {children}
Again, if I remove stylex (and the onClick) there is no issue the button renders.
How to reproduce
- clone: https://github.com/paulm17/stylex
- pnpm i
- pnpm run dev
Expected behavior
should be able to run both as a package and then when built and finally when on npmjs.
Please let me know if I have not followed any documentation or have done something incorrectly!
Many thanks for this library!
Side point, genuinely excited for this project as soon as I heard about it from Theo.
The problem
I know this library is new and not all edge cases have been covered. However, I am trying to use styleX within a pnpm package. Is this a covered use case or a future one? 🤔
I have two pnpm repos that I've tried this with:
Without using stylex, the component builds correctly and is able to be imported by the nextjs app just fine.
When I launch nextjs:
Again, if I remove stylex (and the onClick) there is no issue the button renders.
How to reproduce
Expected behavior
should be able to run both as a package and then when built and finally when on npmjs.
Please let me know if I have not followed any documentation or have done something incorrectly!
Many thanks for this library!