{"id":19010,"library":"babel-messages","title":"babel-messages","description":"A utility package that provides a collection of debug messages used internally by Babel during code transformation and compilation. This package (v6.23.0) is now deprecated in modern Babel versions (v7+) and is no longer updated separately as messages are embedded directly in code or handled by @babel/code-frame. It offers functions like get(key) to retrieve localized message strings. Key differentiator: it is a legacy internal module with no standalone value for end users beyond historical reference.","status":"deprecated","version":"6.23.0","language":"javascript","source_language":"en","source_url":"https://github.com/babel/babel/tree/master/packages/babel-messages","tags":["javascript"],"install":[{"cmd":"npm install babel-messages","lang":"bash","label":"npm"},{"cmd":"yarn add babel-messages","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-messages","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Module only supports namespace import, not default import.","wrong":"import messages from 'babel-messages'","symbol":"messages","correct":"import * as messages from 'babel-messages'"},{"note":"Works with both named import and destructured require, but the package is deprecated and not recommended for new code.","wrong":"const { get } = require('babel-messages')","symbol":"get method","correct":"import { get } from 'babel-messages'"},{"note":"definedMessages is exported as a named export; subpath import is not supported.","wrong":"import definedMessages from 'babel-messages/definedMessages'","symbol":"definedMessages","correct":"import { definedMessages } from 'babel-messages'"}],"quickstart":{"code":"import { get, definedMessages } from 'babel-messages';\n\n// Get a specific debug message\nconsole.log(get('tailCallReassignmentDeopt'));\n// → \"Function reference has been...\"\n\n// List all defined message keys\nconsole.log(Object.keys(definedMessages));\n// → ['tailCallReassignmentDeopt', ...]","lang":"typescript","description":"Shows how to import and use the get() function to retrieve a debug message, and how to list all available message keys via definedMessages."},"warnings":[{"fix":"Replace usage with @babel/code-frame or handle messages manually.","message":"babel-messages is deprecated in Babel v7 and removed in v8. All messages have been moved to @babel/code-frame or embedded directly.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Use import * as messages from 'babel-messages' or named imports like { get }.","message":"Importing using default import (import messages from 'babel-messages') returns undefined.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Only use the documented exports: get and definedMessages.","message":"The package only exports get() and definedMessages. Other symbols like set() are not public.","severity":"gotcha","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install babel-messages@6.23.0 --save-dev (but prefer migrating away)","cause":"Package not installed or removed in newer Babel versions.","error":"Cannot find module 'babel-messages'"},{"fix":"Use import * as messages from 'babel-messages' instead.","cause":"Default import yields undefined because the module uses namespace export.","error":"import messages from 'babel-messages'; console.log(messages.get('...')) TypeError: messages.get is not a function"},{"fix":"Import from 'babel-messages' directly: import { definedMessages } from 'babel-messages'","cause":"Subpath export 'babel-messages/definedMessages' does not exist.","error":"Module not found: Error: Can't resolve 'babel-messages/definedMessages'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}