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

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

Open
leonardoraele opened this issue Feb 25, 2020 · 1 comment

Comments

@leonardoraele
Copy link

leonardoraele commented Feb 25, 2020

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
Copy link

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

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

2 participants