{"id":26982,"library":"fb-babel-plugin-utils","title":"FB Babel Plugin Utils","description":"A collection of shared utility functions used internally by Facebook for building Babel 7 transforms. Version 0.13.1 is the latest stable release, but the package is not intended for public consumption and has no explicit release cadence. It is tightly coupled with Facebook's internal toolchain and the `fbt` (Facebook Translation) ecosystem. Unlike general-purpose Babel utility libraries (e.g., `@babel/helper-plugin-utils`), this package provides internal helpers specific to Facebook's transform infrastructure. It is not recommended for external use.","status":"active","version":"0.13.1","language":"javascript","source_language":"en","source_url":"https://github.com/facebook/fbt","tags":["javascript"],"install":[{"cmd":"npm install fb-babel-plugin-utils","lang":"bash","label":"npm"},{"cmd":"yarn add fb-babel-plugin-utils","lang":"bash","label":"yarn"},{"cmd":"pnpm add fb-babel-plugin-utils","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Babel 7 plugin development","package":"@babel/core","optional":false},{"reason":"Used for AST node creation and manipulation","package":"@babel/types","optional":false}],"imports":[{"note":"This package is ESM-only; CommonJS require may fail depending on Node/Babel configuration.","wrong":"const fbBabelPluginUtils = require('fb-babel-plugin-utils')","symbol":"default","correct":"import fbBabelPluginUtils from 'fb-babel-plugin-utils'"},{"note":"Named exports may be available, but internal structure is undocumented.","wrong":"const { someExport } = require('fb-babel-plugin-utils')","symbol":"someExport","correct":"import { someExport } from 'fb-babel-plugin-utils'"},{"note":"Subpath imports are not supported; always import from the main entry.","wrong":"import types from 'fb-babel-plugin-utils/types'","symbol":"types","correct":"import { types } from 'fb-babel-plugin-utils'"}],"quickstart":{"code":"import fbBabelPluginUtils from 'fb-babel-plugin-utils';\nimport { types as t } from '@babel/core';\n\n// Example usage: check if a node is a JSX element\nconst isJsxElement = fbBabelPluginUtils.isJSXElement(t.JSXElement());\nconsole.log(isJsxElement); // true\n","lang":"javascript","description":"Shows importing the default export and using a utility to check JSX element type."},"warnings":[{"fix":"Do not depend on this package for public projects; consider using @babel/helper-plugin-utils instead.","message":"This package is intended for internal Facebook use only; breaking changes can occur without notice.","severity":"breaking","affected_versions":"all"},{"fix":"Monitor Babel compatibility updates; migrate to standard helpers if needed.","message":"The package may use deprecated Babel 7 APIs that could break in future Babel versions.","severity":"deprecated","affected_versions":">=0.10"},{"fix":"Pin to a specific version and test thoroughly after upgrades.","message":"Exports are undocumented; relying on any specific export is risky as internals can change.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install fb-babel-plugin-utils --save-dev","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'fb-babel-plugin-utils'"},{"fix":"Check the available exports by inspecting the package's index.js or TypeScript definitions.","cause":"The export does not exist or was incorrectly imported.","error":"fbBabelPluginUtils.isJSXElement is not a function"},{"fix":"Use t.jsxElement(...) or t.jSXElement(...) depending on the version.","cause":"Incorrect usage of @babel/types; JSXElement is a node type, not a builder.","error":"TypeError: t.JSXElement is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}