Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requiring external module @babel/register #139

Open
fsdevriver opened this issue Feb 2, 2019 · 9 comments
Open

Requiring external module @babel/register #139

fsdevriver opened this issue Feb 2, 2019 · 9 comments

Comments

@fsdevriver
Copy link

fsdevriver commented Feb 2, 2019

I follow your instruction, but unfortunately i got an errror says

Requiring external module @babel/register

I use laragon for dev server

@tony-keller
Copy link

tony-keller commented Feb 11, 2019

FYI this is normal, in order to compile from ES6 syntax to JS.
You have the same problem as me and I didn't find the time to fix it yet and it can take up to a few minutes to register on my machine depending on project!! Crazy as some guys have it loaded in just 2 seconds. Edit: I now have new imac with 40Gb of ram and it now takes 2 seconds.

@max-cmoa
Copy link

I have a similar issue. Here is the console message

Requiring external module @babel/register
/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_modules/@babel/core/lib
/config/config-descriptors.js:178
throw new Error(Plugin/Preset files are not allowed to export objects, only functions. In ${file path});
^

Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/edelsteinm/Lo
cal Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_modules/babel-preset-es2015/lib/index.js
at createDescriptor (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/nod

e_modules/@babel/core/lib/config/config-descriptors.js:178:11)
at items.map (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_modul
es/@babel/core/lib/config/config-descriptors.js:109:50)
at Array.map ()
at createDescriptors (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/no
de_modules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPresetDescriptors (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/c
moa/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
at presets (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_modules
/@babel/core/lib/config/config-descriptors.js:47:19)
at mergeChainOpts (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_

modules/@babel/core/lib/config/config-chain.js:320:26)
at /Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_modules/@babel/c
ore/lib/config/config-chain.js:283:7
at buildRootChain (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/cmoa/node_
modules/@babel/core/lib/config/config-chain.js:120:22)
at loadPrivatePartialConfig (/Users/edelsteinm/Local Sites/cmoa2019/app/public/wp-content/themes/
cmoa/node_modules/@babel/core/lib/config/partial.js:85:55)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] start: gulp
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/edelsteinm/.npm/_logs/2019-10-18T15_13_42_678Z-debug.log

Please see the debug.log file attached.
2019-10-18T15_06_00_223Z-debug.log

@redtux
Copy link

redtux commented Nov 10, 2020

I installed @babel/register (alongside the older babel-register package that is being used by WPGulp), and everything seems to work fine.

@redtux
Copy link

redtux commented Nov 10, 2020

@hhasan16 & @max-cmoa: Could you provide a link to a WP theme plus corresponding package.json and wpgulp.config.js files, please?

It seems I can reproduce this bug. What versions of node and npm are you using?

@max-cmoa
Copy link

This was a long time ago. I forgot about this. I am not running into this issue anymore. For you information I am using:
node v10.21.0
npm 6.14.4

I can't link to the theme I am using, because it is proprietary. My apologies for this.

@mat-cat
Copy link

mat-cat commented Nov 12, 2020

hello,
i'm testing the wpgulp workflow and i have the babel/register requiring bug. I'm using the last node and npm version.
tried to re install @babel/register but it still doesn't work

any new idea ?

thanks !!! ( great job )

@max-cmoa
Copy link

@mat-cat Did you try to delete your node_modules directory and reinstall them?

@mat-cat
Copy link

mat-cat commented Nov 13, 2020

Yop,
I did but same error

@redtux
Copy link

redtux commented Nov 13, 2020

Hi @mat-cat! Maybe using nvm and trying node v10 instead of v12 or v14 helps. When I run e.g. npm run translate I get the message that @babel/register is required (which is newer), while babel-register (the older package) is used when just running gulp translate (or any other task). You could also try to globally upgrade gulp, but I am not sure if this will work, as the deprecated gulp-util and other outdated packages are needed for certain WPGulp tasks. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants