Deck.gl: Webpack failure with @loaders.gl/images

Created on 6 May 2020  Â·  8Comments  Â·  Source: visgl/deck.gl

I get this error when attempting to run deck.gl with webpack:

ERROR in ./node_modules/@deck.gl/core/dist/esm/lib/init.js
Module not found: Error: Can't resolve '@loaders.gl/images' in '/Users/<user>/workspace/source/tracegraph/web/src/main/js/visualizer/node_modules/@deck.gl/core/dist/esm/lib'
 @ ./node_modules/@deck.gl/core/dist/esm/lib/init.js 2:0-49 25:31-42
 @ ./node_modules/@deck.gl/core/dist/esm/index.js
 @ ./node_modules/deck.gl/dist/esm/index.js
 @ ./src/viz/map/index.js
 @ ./src/graphing.js
 @ ./src/index.js

I assume I'm missing a rule in webpack config?

FAQ question

Most helpful comment

I ran into a similar problem with this module while using yarn autoclean. The 'images' submodule would be deleted after every install due to the 'images' entry in the default .yarnclean config. The issue was solved by simply removing the 'images' entry from the asset directories section.

```...

asset directories

docs
doc
website
images
assets

...
```

All 8 comments

I've added @loaders.gl/images to my root package.json but the error persists.

It's unclear to me why this works, but deleting node_modules and removing package/yarn lock file, reinstall fixed the issue.

This does not seem to be related to deck.gl.

I ran into a similar problem with this module while using yarn autoclean. The 'images' submodule would be deleted after every install due to the 'images' entry in the default .yarnclean config. The issue was solved by simply removing the 'images' entry from the asset directories section.

```...

asset directories

docs
doc
website
images
assets

...
```

@LittleMik thanks for following up with your findings, that is interesting.

We are big yarn users but not familiar with .yarnclean, and we have not run into this issue even though we make very extensive use of yarn.

While we want things to work smoothly for everyone,I hesitate to rename a module just because of this, unless it is a bigger issue than I realize.

At first blush, it would seem like a yarn issue - they shouldn't wipe out modules that happen to have the same name as asset directories. I would suggest opening an issue there and reference this ticket.

@ibgreen I completely agree, you shouldn't have to rename the module.

Yarn autoclean docs 'highly recommend' reviewing .yarnclean entries but it would be more ideal if modules were handled by yarn.

Hope the current solution helps solve this type of issue in the meantime.

@LittleMik Removing images from yarnclean fixed it. Thanks so much for this. Agreed with the talking points above — it was driving me crazy though, so worth a note in the README IMO.

A PR is welcome if anyone has a good idea where to add a link to this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SymbolixAU picture SymbolixAU  Â·  4Comments

FilipHusnjak picture FilipHusnjak  Â·  3Comments

heumsi picture heumsi  Â·  4Comments

ctriley picture ctriley  Â·  3Comments

ToddJacobus picture ToddJacobus  Â·  4Comments