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

esbuild plugin has undeclared dependency on babel-plugin-syntax-hermes-parser #576

Closed
welkup opened this issue May 19, 2024 · 0 comments · Fixed by #579
Closed

esbuild plugin has undeclared dependency on babel-plugin-syntax-hermes-parser #576

welkup opened this issue May 19, 2024 · 0 comments · Fixed by #579
Labels
bug Something isn't working

Comments

@welkup
Copy link

welkup commented May 19, 2024

Describe the issue

The esbuild plugin's index.js file imports from 'babel-plugin-syntax-hermes-parser', but the esbuild plugin does not declare this dependency in its package.json. This results in the following error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'babel-plugin-syntax-hermes-parser' imported from //node_modules/@stylexjs/esbuild-plugin/lib/index.js
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:782:9)
at moduleResolve (node:internal/modules/esm/resolve:831:20)
at defaultResolve (node:internal/modules/esm/resolve:1036:11)
at DefaultModuleLoader.resolve (node:internal/modules/esm/loader:251:12)
at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:140:32)
at ModuleWrap. (node:internal/modules/esm/module_job:76:33)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

Expected behavior

The esbuild plugin should run without the need to install the babel-plugin-syntax-hermes-parser as a direct dependency of the application.

Steps to reproduce

  1. git clone https://github.com/facebook/stylex.git
  2. mv stylex/apps/esbuild-example/ .
  3. cd esbuild-example
  4. npm i
  5. npm run build

Test case

No response

Additional comments

Can work around by installing the hermes parser as a dependency of your main app.

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

Successfully merging a pull request may close this issue.

1 participant