Search code examples
serverless-frameworkserverless

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).


Solution

  • 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.