handlebars-helpers icon indicating copy to clipboard operation
handlebars-helpers copied to clipboard

Dependency not found: 'readline' | dependencies cannot be statically extracted

Open leonardoraele opened this issue 5 years ago • 1 comments

Hi,

I got the following error when building my Vue app with webpack after installing handlebars-helpers as dependency with npm i handlebars-helpers.

ERROR  Failed to compile with 1 errors

This dependency was not found:

* readline in ./node_modules/log-utils/index.js

To install it, you can run: npm install --save readline

I don't understand why there is a missing dep that I have to manually install, but I proceeded to install readline as suggested anyway. Now I'm able to build the app without errors, but I still get some warnings:

WARNING  Compiled with 3 warnings

 warning  in ./node_modules/handlebars-helpers/lib/utils/utils.js

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

 warning  in ./node_modules/create-frame/utils.js

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

 warning  in ./node_modules/log-utils/node_modules/ansi-colors/index.js

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

As I understand the situation, npm isn't able to track handlebars-helpers's dependencies so I had to install them manually and now my package.json includes a readline dependency that my project don't actually depends on (directly).

leonardoraele avatar Feb 25 '20 23:02 leonardoraele

I found a work around.

import { DefinePlugin } from "webpack";

config.plugins = [
  // Stop build hanging https://github.com/node-formidable/formidable/issues/337#issuecomment-153408479
  new DefinePlugin({ "global.GENTLY": false }),
]

gruckion avatar Oct 11 '22 18:10 gruckion