Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@stylexjs/cli Missing Plugin #624

Closed
besSejrani opened this issue Jun 29, 2024 · 2 comments
Closed

@stylexjs/cli Missing Plugin #624

besSejrani opened this issue Jun 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@besSejrani
Copy link

besSejrani commented Jun 29, 2024

Describe the issue

When I try to run the cli on a single .tsx file, I get following error

parser/lib/index.js:10365:23) { code: 'BABEL_PARSE_ERROR', reasonCode: 'MissingOneOfPlugins', loc: Position { line: 16, column: 4, index: 324 }, pos: 324, missingPlugin: [ 'jsx', 'flow', 'typescript' ] }

this is my stylex.json file

{ "input": "./src/Components/ui", "output": "./stylex", "modules_EXPERIMENTAL": ["@stylexjs/open-props"], "styleXBundleName": "stylex_bundle.css" }

One other problem, after installing the cli

I can't just use stylex directly, i need to do npx stylex --config stylex.json or pnpm stylex --config stylex.json

i get following error

zsh: command not found: stylex

Expected behavior

I would expect to be able to use the cli directly, maybe configure the .json file before hand

Steps to reproduce

  • Create a .tsx component
  • Install @stylexjs/cli
  • Add following stylex.json config { "input": "./src/Components/ui", "output": "./stylex", "modules_EXPERIMENTAL": ["@stylexjs/open-props"], "styleXBundleName": "stylex_bundle.css" }
  • Verify the error message

Test case

No response

Additional comments

No response

@besSejrani besSejrani added the bug Something isn't working label Jun 29, 2024
@nmn
Copy link
Contributor

nmn commented Jun 30, 2024

Please see the example app using the CLI. You have to use the babelPresets key in the configuration to enable the CLI to understand TS syntax.

We are working on adding more configuration options.

@besSejrani
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants