Skip to content

fix(deps): declare @babel/generator and @babel/traverse as dependencies#9873

Merged
MatiPl01 merged 1 commit into
software-mansion:mainfrom
0xyy:fix/declare-worklets-babel-plugin-deps
Jul 3, 2026
Merged

fix(deps): declare @babel/generator and @babel/traverse as dependencies#9873
MatiPl01 merged 1 commit into
software-mansion:mainfrom
0xyy:fix/declare-worklets-babel-plugin-deps

Conversation

@0xyy

@0xyy 0xyy commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9648. Follow-up to #9511.

The bundled Worklets Babel plugin keeps its Babel imports external (packages: 'external' in plugin/bundle.js), so the published bundle calls require('@babel/generator') and require('@babel/traverse') at runtime. Neither package is declared in dependencies, so package managers with an isolated layout (e.g. pnpm 11 with a global virtual store) fail to load the plugin with:

Error: Cannot find module '@babel/generator'

This PR declares both packages as dependencies, the same way #9511 did for @babel/types. Both ranges resolve to versions already present in the dependency tree, so no new packages are pulled in.

Test plan

Used the reproduction from #9648 (pnpm 11, enableGlobalVirtualStore: true, node repro.js loading react-native-worklets/plugin):

  • react-native-worklets packed from main without this change: fails with Cannot find module '@babel/generator'
  • packed with this change: Plugin loaded successfully.

@MatiPl01 MatiPl01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@MatiPl01 MatiPl01 added this pull request to the merge queue Jul 3, 2026
Merged via the queue into software-mansion:main with commit 215b260 Jul 3, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-native-worklets does not declare @babel/generator or @babel/traverse

2 participants