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

Builds failing with error: Binding not found for ReferencedIdentifier "createOption" present in "AssignmentExpression" #1054

Open
hasan-rahman opened this issue Dec 5, 2024 · 1 comment

Comments

@hasan-rahman
Copy link

hasan-rahman commented Dec 5, 2024

Our builds started failing yesterday. When we override @babel/traverse to 7.25.9, the builds are working fine. @babel/traverse v7.26.3 seems to be the culprit.

  1. Minimal code to reproduce the bug
    Angular app running Storybook

  2. Stack Trace

Error: /azp/_work/1/s/tools/src/storybook/argTypes/api.ts: Binding not found for ReferencedIdentifier "createOption" present in "AssignmentExpression". Please report this at https://github.com/babel/minify/issues/new
    at ReferencedIdentifier (/azp/_work/1/s/node_modules/babel-plugin-minify-mangle-names/lib/index.js:199:19)
    at newFn (/azp/_work/1/s/node_modules/@babel/traverse/lib/visitors.js:205:17)
    at bfsTraverse (/azp/_work/1/s/node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js:38:43)
    at Mangler.collect (/azp/_work/1/s/node_modules/babel-plugin-minify-mangle-names/lib/index.js:235:7)
    at Mangler.run (/azp/_work/1/s/node_modules/babel-plugin-minify-mangle-names/lib/index.js:60:12)
    at PluginPass.exit (/azp/_work/1/s/node_modules/babel-plugin-minify-mangle-names/lib/index.js:546:19)
    at newFn (/azp/_work/1/s/node_modules/@babel/traverse/lib/visitors.js:170:14)
    at NodePath._call (/azp/_work/1/s/node_modules/@babel/traverse/lib/path/context.js:50:20)
    at NodePath.call (/azp/_work/1/s/node_modules/@babel/traverse/lib/path/context.js:40:18)
    at NodePath.visit (/azp/_work/1/s/node_modules/@babel/traverse/lib/path/context.js:97:8) {
  code: 'BABEL_TRANSFORM_ERROR'
}
##[error]> 1

##[error]Bash exited with code '1'.
  1. Configuration - babel-minify configuration or babelrc
module.exports = {
  plugins: [
    [
      'inline-dotenv',
      {
        unsafe: true,
      },
    ],
  ],
  presets: [
    ['minify'],
    '@babel/preset-env',
    '@babel/preset-typescript',
    '@babel/preset-react',
  ],
};
  1. Whether you used it with other presets/plugins - like es2015 or env
    See below

  2. Environment: gulp, rollup, webpack, babel-cli, etc...?

"@babel/cli": "^7.13.0",
"@babel/core": "^7.14.0",
"@babel/eslint-parser": "^7.21.3",
"@babel/preset-env": "^7.14.0",
"@babel/preset-react": "^7.13.0",
"@babel/preset-typescript": "^7.13.0",
@JLHwung
Copy link
Contributor

JLHwung commented Dec 5, 2024

Did you try upgrading to @babel/traverse 7.26.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants