helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

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

Open leonardoraele opened 4 years ago

leonardoraele commented 4 years ago

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

gruckion commented 1 year ago

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 }),
]