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

Error: Cannot find module 'es6-weak-map' #14

Open
tgandrews opened this issue Feb 1, 2019 · 0 comments · May be fixed by #15
Open

Error: Cannot find module 'es6-weak-map' #14

tgandrews opened this issue Feb 1, 2019 · 0 comments · May be fixed by #15

Comments

@tgandrews
Copy link

tgandrews commented Feb 1, 2019

Recreation steps

  1. Create a new node project
  2. Run npm install --save deep-map
  3. Create an index.js with
const deepMap = require("deep-map");
console.log("hello world");
  1. Run the index.js

Expect

hello world

Actual

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'es6-weak-map'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
	...

Reason

es6-weak-map was moved to being a dev dependency in 1a98c4e
but it should not have been

tgandrews added a commit to tgandrews/deep-map that referenced this issue Feb 1, 2019
Only dependencies are installed by default by clients and as this
is required at runtime it needs to be installed.

Closes mcmath#14
@tgandrews tgandrews linked a pull request Feb 1, 2019 that will close this issue
Cruikshanks added a commit to DEFRA/water-abstraction-import that referenced this issue Nov 29, 2022
So, with our bump of the helpers everything broke! After investigation this was because `scripts/licence-creator/index.js` was requiring [deep-map](https://github.com/mcmath/deep-map) to do some work (see new comment in code to find out what that is).

The problem is **deep-map** was then requiring `es6-weak-map` but only had it listed as a dev dependency. This is raised [as an issue](mcmath/deep-map#14) and someone has even gone to the effort of creating a [fix PR](mcmath/deep-map#15). But to no avail as these were done in 2019 and multiple pings to the contributor have not resulted in the fix being merged.

The last release was 4 years ago so this is clearly an abandoned project. Also, we've been able to replicate what it was doing with very little extra code so it was unnecessary in the first place.
Cruikshanks added a commit to DEFRA/water-abstraction-import that referenced this issue Dec 1, 2022
DEFRA/water-abstraction-team#45
DEFRA/water-abstraction-helpers#200

This resolves an issue in specific scenarios where the logger in helpers expects an instance of `Error`.

It also removes the dead deep-map dependency. When we bumped the helpers everything broke! After investigation, this was because `scripts/licence-creator/index.js` was requiring [deep-map](https://github.com/mcmath/deep-map) to do some work (see new comment in code to find out what that is).

The problem is **deep-map** was then requiring `es6-weak-map` but only had it listed as a dev dependency. This is raised [as an issue](mcmath/deep-map#14) and someone has even gone to the effort of creating a [fix PR](mcmath/deep-map#15). But to no avail, as these were done in 2019 and multiple pings to the contributor have not resulted in the fix being merged.

The last release was 4 years ago so this is clearly an abandoned project. Also, we've been able to replicate what it was doing with very little extra code so it was unnecessary in the first place.
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

Successfully merging a pull request may close this issue.

1 participant