Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serverless WARNING: Could not determine version of module babel-runtime

I'm running sls deploy and getting the following warning that spams many lines.

Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
Serverless: WARNING: Could not determine version of module babel-runtime
...

What is the cause of this warning, should I be concerned? How do I fix it?

(If I need to add extra information to this question, please let me know and I'll edit the question right away).

like image 552
Joseph Astrahan Avatar asked Nov 21 '17 01:11

Joseph Astrahan


1 Answers

I'm having the same issue in the following scenario:

Serverless + Webpack + Babel

In recommended webpack config, dev-dependencies are excluded. Babel-runtime (depends of babel, normally added as dev-dependency) is a dev-dependency too.

If you add babel-runtime to your common dependecies, now serverless (using webpack) will package babel-runtime with full information about the package (in this case, the version required).

yarn add babel-runtime

or

npm i babel-runtime

You can avoid these warnings.

like image 126
Gonzalo Avatar answered Nov 08 '22 13:11

Gonzalo