-
Hey there. I'm wondering if my expectations are correct when it comes to the CLI Example directory in the apps directory. Really want to start giving the CLI a spin.
Happy to give more feedback, but I feel like right now you're probably aware of something and me pasting in a bunch of terminal errors wouldn't be helpful. If I'm mistaken and I can provide any info, please let me know, happy to do so. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 16 replies
-
The current CLI example doesn't integrate with an existing framework like next because npm has some weird issues with how it builds in our monorepo setup. @nmn put together an intentionally unmerged PR with a next example, not sure if it's finished though If you share what errors you're facing in setting it up I can look into it. |
Beta Was this translation helpful? Give feedback.
-
NPM and Next.js is giving me trouble which is why it isn't merged for now. I've also put up a separate repo with a Next example: https://github.com/nmn/next-15-with-stylex-cli In my experience that works in both dev and prod very well. The main issues I'm running into are:
|
Beta Was this translation helpful? Give feedback.
-
I noticed in your latest PR @Jta26
So it appears that Going to give it another try. |
Beta Was this translation helpful? Give feedback.
-
Well, if I run I can see the stylex_compiled_modules directory now in the output But if I try to run node_modules/@stylexjs/stylex/lib/es/stylex.mjs (174:1) @ errorForFn
⨯ Error: 'stylex.defineVars' should never be called at runtime. It should be compiled away by '@stylexjs/babel-plugin'
at __webpack_require__ (/Users/brian.mccarthy/Development/next-15-with-stylex-cli/.next/server/webpack-runtime.js:33:42)
at __webpack_require__ (/Users/brian.mccarthy/Development/next-15-with-stylex-cli/.next/server/webpack-runtime.js:33:42)
at eval (./src/app/page.js:11:86)
at (ssr)/./src/app/page.js (/Users/brian.mccarthy/Development/next-15-with-stylex-cli/.next/server/app/page.js:140:1)
at Object.__webpack_require__ [as require] (/Users/brian.mccarthy/Development/next-15-with-stylex-cli/.next/server/webpack-runtime.js:33:42)
digest: "2547279488"
172 | styleq.factory = createStyleq;
173 |
> 174 | const errorForFn = name => new Error(`'stylex.${name}' should never be called at runtime. It should be compiled away by '@stylexjs/babel-plugin'`);
| ^
175 | const errorForType = key => errorForFn(`types.${key}`);
176 | function props() {
177 | const options = this; |
Beta Was this translation helpful? Give feedback.
-
i get also the same error |
Beta Was this translation helpful? Give feedback.
-
@Jta26 has made some improvements to CLI since these issues were reported. Will test and cut a new release soon. |
Beta Was this translation helpful? Give feedback.
@Jta26 has made some improvements to CLI since these issues were reported. Will test and cut a new release soon.