Skip to content

Different case for "Dependency not found" #227

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

Closed
Sydney-o9 opened this issue Dec 22, 2017 · 1 comment
Closed

Different case for "Dependency not found" #227

Sydney-o9 opened this issue Dec 22, 2017 · 1 comment

Comments

@Sydney-o9
Copy link

Sydney-o9 commented Dec 22, 2017

From Symfony Encore - FAQ.

This dependency was not found: some-module in ./path/to/file.js
Typically, a package will "advertise" its "main" file by adding a main key to its package.json.
But sometimes, old libraries won't have this.

I seem to have a different scenario than the one above.

image


To reproduce this, you may simply use the pace-js library which is only a single js file pace-js/pace.js.

1 add pace-js using yarn

$ yarn add --dev pace-js

2 Add pace-js to webpack.config.js

Encore
// ...
    .addEntry('whatever', 'pace-js')

Note: I also tried to include pace-js in a js file directly. Same error.

require('pace-js/pace.js');

3 Compile assets

 $ ./node_modules/.bin/encore dev
Running webpack ...

 ERROR  Failed to compile with 1 errors                                          15:53:54

This dependency was not found:

* pace in ./node_modules/pace-js/pace.js

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

It seems webpack via Encore is asking for a library pace which has nothing to do with this package at all.

@Sydney-o9
Copy link
Author

Sydney-o9 commented Dec 22, 2017

Nothing to do with Symfony webpack-encore. This is a pace-js issue.

However, if anyone has a similar error, take good care of Named Modules as indicated by @fson (naming the module in the define call should be avoided)

You should avoid naming modules yourself, and only place one module in a file while developing.

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

1 participant