Deprecated Babel preset that throws an error and directs users to migrate to individual stage 3 plugins
npx @tessl/cli install tessl/npm-babel--preset-stage-3@7.8.0⚠️ DEPRECATED PACKAGE - This Babel preset was deprecated as of v7.0.0-beta.55. The package throws an error when used and directs users to migrate to individual stage 3 plugins for better long-term maintenance and clearer understanding of experimental features.
npm install @babel/preset-stage-3 (not recommended - package is deprecated)lib/index.js (references compiled source from /src/index.js)Note: This preset is typically used in Babel configuration files rather than imported directly in application code.
ESM (in Node.js modules):
import presetStage3 from "@babel/preset-stage-3";CommonJS:
const presetStage3 = require("@babel/preset-stage-3");Important: Direct imports are not the typical usage pattern. The error occurs when this preset is used in Babel configuration.
This package no longer provides functional preset configuration. Instead, it throws an error with migration instructions when used. The Babel team removed stage presets to encourage explicit plugin selection rather than adopting all experimental features in a given stage.
Instead of using this deprecated preset, configure the following individual plugins:
{
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings"
]
}npx babel-upgrade for automatic configuration updatesFor projects needing shared configuration across multiple packages, create a custom preset:
module.exports = function() {
return {
plugins: [
require("@babel/plugin-syntax-dynamic-import"),
[require("@babel/plugin-proposal-decorators"), { "legacy": true }],
[require("@babel/plugin-proposal-class-properties"), { "loose": false }],
],
presets: [
// Additional presets as needed
],
};
};The package exports a single function that immediately throws an error with migration instructions.
/**
* Deprecated preset function that throws an error with migration instructions
* @throws {Error} Always throws with detailed migration guidance
* @returns {never} Never returns, always throws
*/
export default function(): never;Behavior: When called, this function throws an Error containing:
babel-upgrade for automated migrationThe thrown error includes comprehensive migration information:
babel-upgrade for automated updatesThis preset would normally be used in Babel configuration files. All of these configurations will now throw an error:
// .babelrc (DEPRECATED - will throw error)
{
"presets": ["@babel/preset-stage-3"]
}// babel.config.js (DEPRECATED - will throw error)
module.exports = {
presets: ["@babel/preset-stage-3"]
};// package.json babel config (DEPRECATED - will throw error)
{
"babel": {
"presets": ["@babel/preset-stage-3"]
}
}When Babel processes any of these configurations, the preset function is called and immediately throws the deprecation error.
When migrating to individual plugins, note the following compatibility requirements:
@babel/plugin-proposal-decorators, it must come before @babel/plugin-proposal-class-properties@babel/plugin-proposal-decorators with legacy: true, @babel/plugin-proposal-class-properties must use loose: trueloose option is not requiredThe complete error message thrown by this package:
As of v7.0.0-beta.55, we've removed Babel's Stage presets.
Please consider reading our blog post on this decision at
https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
for more details. TL;DR is that it's more beneficial in the
long run to explicitly add which proposals to use.
For a more automatic migration, we have updated babel-upgrade,
https://github.com/babel/babel-upgrade to do this for you with
"npx babel-upgrade".
If you want the same configuration as before:
{
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings"
]
}
If you're using the same configuration across many separate projects,
keep in mind that you can also create your own custom presets with
whichever plugins and presets you're looking to use.
module.exports = function() {
return {
plugins: [
require("@babel/plugin-syntax-dynamic-import"),
[require("@babel/plugin-proposal-decorators"), { "legacy": true }],
[require("@babel/plugin-proposal-class-properties"), { "loose": false }],
],
presets: [
// ...
],
};
};