-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
freeCodeCamp/freeCodeCamp#51403
Easiest thing to do is to start up a Gitpod instance of that PR - it will automatically build until the error in the client terminal:
https://gitpod.io/#https://github.com/freeCodeCamp/freeCodeCamp/pull/51403
Configuration file name
.babelrc.js
Configuration
require('dotenv').config({ path: '../.env' });
const config = {
presets: [
[
'@babel/preset-env',
{
loose: true,
modules: false,
useBuiltIns: 'usage',
corejs: 2,
shippedProposals: true,
targets: {
browsers: ['>0.25%', 'not dead']
}
}
],
[
'@babel/preset-react',
{
useBuiltIns: true,
pragma: 'React.createElement'
}
],
'@babel/preset-typescript'
],
plugins: [
'preval',
'@babel/plugin-syntax-dynamic-import',
'babel-plugin-macros',
[
'@babel/plugin-transform-runtime',
{
helpers: true,
regenerator: true
}
],
[
'babel-plugin-transform-imports',
{
'react-bootstrap': {
transform: 'react-bootstrap/lib/${member}',
preventFullImport: true
}
}
],
[
'prismjs',
{
languages: [
'clike',
'css',
'html',
'javascript',
'markup',
'mathml',
'pug',
'python',
'sql',
'svg',
'typescript',
'xml'
],
theme: 'default',
css: true,
plugins: ['line-numbers']
}
]
]
};
if (
process.env.FREECODECAMP_NODE_ENV === 'development' &&
process.env.CODESEE === 'true'
) {
config.plugins.push(['@codesee/instrument', { hosted: true }]);
}
module.exports = config;Current and expected behavior
Our client/ build fails when we update @babel/preset-env from 7.22.9 to 7.22.10 with the following errors:
Console output
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-async-generators@7.8.4_@babel+core@7.22.11/node_modules/@babel/plu
gin-syntax-async-generators/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-async-generators@7.8.4_@babel+core@7.22.11/node_modules/@babel/plu
gin-syntax-async-generators/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-bigint@7.8.3_@babel+core@7.22.11/node_modules/@babel/plugin-syntax
-bigint/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-bigint@7.8.3_@babel+core@7.22.11/node_modules/@babel/plugin-syntax
-bigint/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-class-properties/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-class-properties/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-class-static-block@7.14.5_@babel+core@7.22.11/node_modules/@babel/
plugin-syntax-class-static-block/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-class-static-block@7.14.5_@babel+core@7.22.11/node_modules/@babel/
plugin-syntax-class-static-block/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-decorators@7.22.10_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-decorators/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-decorators@7.22.10_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-decorators/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-decorators@7.22.10_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-decorators/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-dynamic-import@7.8.3_@babel+core@7.22.11/node_modules/@babel/plugi
n-syntax-dynamic-import/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-dynamic-import@7.8.3_@babel+core@7.22.11/node_modules/@babel/plugi
n-syntax-dynamic-import/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-export-default-from@7.22.5_@babel+core@7.22.11/node_modules/@babel
/plugin-syntax-export-default-from/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-export-default-from@7.22.5_@babel+core@7.22.11/node_modules/@babel
/plugin-syntax-export-default-from/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-export-default-from@7.22.5_@babel+core@7.22.11/node_modules/@babel
/plugin-syntax-export-default-from/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-export-namespace-from@7.8.3_@babel+core@7.22.11/node_modules/@babe
l/plugin-syntax-export-namespace-from/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-export-namespace-from@7.8.3_@babel+core@7.22.11/node_modules/@babe
l/plugin-syntax-export-namespace-from/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-flow@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-syntax-
flow/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-flow@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-syntax-
flow/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-flow@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-syntax-
flow/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-function-bind@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugi
n-syntax-function-bind/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-function-bind@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugi
n-syntax-function-bind/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-function-bind@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugi
n-syntax-function-bind/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-assertions@7.22.5_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-import-assertions/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-assertions@7.22.5_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-import-assertions/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-assertions@7.22.5_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-import-assertions/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-attributes@7.22.5_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-import-attributes/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-attributes@7.22.5_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-import-attributes/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-attributes@7.22.5_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-import-attributes/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-meta@7.10.4_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-import-meta/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-import-meta@7.10.4_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-import-meta/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-json-strings@7.8.3_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-json-strings/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-json-strings@7.8.3_@babel+core@7.22.11/node_modules/@babel/plugin-
syntax-json-strings/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-jsx@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-syntax-j
sx/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-jsx@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-syntax-j
sx/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-jsx@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-syntax-j
sx/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-logical-assignment-operators@7.10.4_@babel+core@7.22.11/node_modul
es/@babel/plugin-syntax-logical-assignment-operators/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-logical-assignment-operators@7.10.4_@babel+core@7.22.11/node_modul
es/@babel/plugin-syntax-logical-assignment-operators/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-nullish-coalescing-operator@7.8.3_@babel+core@7.22.11/node_modules
/@babel/plugin-syntax-nullish-coalescing-operator/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-nullish-coalescing-operator@7.8.3_@babel+core@7.22.11/node_modules
/@babel/plugin-syntax-nullish-coalescing-operator/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-numeric-separator@7.10.4_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-numeric-separator/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-numeric-separator@7.10.4_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-numeric-separator/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-object-rest-spread@7.8.3_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-object-rest-spread/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-object-rest-spread@7.8.3_@babel+core@7.22.11/node_modules/@babel/p
lugin-syntax-object-rest-spread/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-optional-catch-binding@7.8.3_@babel+core@7.22.11/node_modules/@bab
el/plugin-syntax-optional-catch-binding/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-optional-catch-binding@7.8.3_@babel+core@7.22.11/node_modules/@bab
el/plugin-syntax-optional-catch-binding/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-optional-chaining@7.8.3_@babel+core@7.22.11/node_modules/@babel/pl
ugin-syntax-optional-chaining/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-optional-chaining@7.8.3_@babel+core@7.22.11/node_modules/@babel/pl
ugin-syntax-optional-chaining/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-private-property-in-object@7.14.5_@babel+core@7.22.11/node_modules
/@babel/plugin-syntax-private-property-in-object/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-private-property-in-object@7.14.5_@babel+core@7.22.11/node_modules
/@babel/plugin-syntax-private-property-in-object/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-top-level-await@7.14.5_@babel+core@7.22.11/node_modules/@babel/plu
gin-syntax-top-level-await/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-top-level-await@7.14.5_@babel+core@7.22.11/node_modules/@babel/plu
gin-syntax-top-level-await/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-typescript@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-s
yntax-typescript/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-typescript@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-s
yntax-typescript/README.md:1:1
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:10)
File:../node_modules/.pnpm/@babel+plugin-syntax-typescript@7.22.5_@babel+core@7.22.11/node_modules/@babel/plugin-s
yntax-typescript/lib/index.js.map:1:10
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected token (1:4)
File:../node_modules/.pnpm/@babel+plugin-syntax-unicode-sets-regex@7.18.6_@babel+core@7.22.11/node_modules/@babel/
plugin-syntax-unicode-sets-regex/LICENSE:1:4
ERROR #98123 WEBPACK
Generating development SSR bundle failed
Unexpected character ' ' (1:1)
File:../node_modules/.pnpm/@babel+plugin-syntax-unicode-sets-regex@7.18.6_@babel+core@7.22.11/node_modules/@babel/
plugin-syntax-unicode-sets-regex/README.md:1:1Environment
For the client:
"@babel/plugin-proposal-export-default-from": "7.22.5",
"@babel/plugin-proposal-function-bind": "7.22.5",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "7.22.10",
"@babel/preset-react": "7.22.5",
"@babel/runtime": "^7.20.13",
"@babel/standalone": "7.22.13",- Nodejs v18
- Ubuntu 20.04.6
- Monorepo: yes
- Gatsby v3
Possible solution
I have not been able to go through all the changes in the new version, but the most likely candidate seems around here:
v7.22.9...v7.22.10#diff-2281f56422073bffd4b039230999ad8fe300fa0ce0fe9af45580695488c82f68
Additional context
I have verified and re-verified that the issue is just the update from @babel/preset-env@7.22.9 -> @babel/preset-env@7.22.10.
Here is a failing CI build: https://github.com/freeCodeCamp/freeCodeCamp/actions/runs/6011572923/job/16305206502?pr=51403