You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". #8
A bit more info and a solution: In my case I have a module for Gutenberg which has scripts for building a Gutenberg block in JavaScript. The requirements for that are Babel@^7.0 but I also need to build Drupal JS in the same module. The error gets thrown due to .babelrc specifying presets. If I comment out .babelrc then no error is thrown.
In babelrc it is possible to restrict presets and plugins to specific environments. In mine I've set the needed config to only apply in the NODE_ENV=babel7 environment:
Activity
tanc commentedon Jan 19, 2022
Also seeing this problem
tanc commentedon Jan 19, 2022
A bit more info and a solution: In my case I have a module for Gutenberg which has scripts for building a Gutenberg block in JavaScript. The requirements for that are Babel@^7.0 but I also need to build Drupal JS in the same module. The error gets thrown due to
.babelrcspecifyingpresets. If I comment out.babelrcthen no error is thrown.In
babelrcit is possible to restrict presets and plugins to specific environments. In mine I've set the needed config to only apply in theNODE_ENV=babel7environment:This way I can run my build script like this (from
package.json):and my
drupal-js-buildfrom the command line like this: