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

BUG: Missing dependency on es6-weak-map prevents the module from working #75

Closed
jan-molak opened this issue Aug 24, 2023 · 5 comments
Closed

Comments

@jan-molak
Copy link

jan-molak commented Aug 24, 2023

Hi @TheUnderScorer!

nx-semantic-release version 2.6.0 introduced a dependency on deep-map
Since deep-map relies on es6-weak-map, but doesn't specify it in its prod dependencies (see mcmath/deep-map#14), any consuming module must add a dependency on es6-weak-map itself.

However, even though nx-semantic-release module specifies this dependency, the package.json file produced as a result of its build process DOES NOT (see package.json on npmjs.com):

{
  "name": "@theunderscorer/nx-semantic-release",
  "version": "2.6.0",
  "description": "Semantic release for NX.",
  "publishConfig": {
    "access": "public",
    "registry": "https://registry.npmjs.org/"
  },
  "dependencies": {
    "@nx/devkit": "16.0.0",
    "@semantic-release/changelog": "^6.0.2",
    "@semantic-release/exec": "^6.0.3",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/github": "^8.0.7",
    "@semantic-release/npm": "^9.0.2",
    "cosmiconfig": "^7.0.1",
    "deep-map": "^2.0.0",
    "remeda": "^0.0.32",
    "semantic-release": "20.1.0",
    "semantic-release-plugin-decorators": "3.0.1"
  },
  "private": false,
  "author": {
    "email": "[REDACTED]",
    "name": "[REDACTED]"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/TheUnderScorer/nx-semantic-release"
  },
  "engines": {
    "node": ">=16.0.0"
  },
  "license": "MIT",
  "builders": "./builders.json",
  "executors": "./builders.json",
  "generators": "./generators.json",
  "main": "./src/index.js",
  "types": "./src/index.d.ts"
}

Missing dependency on es6-weak-map prevents nx-semantic-release 2.6.0 from working:

   Require stack:
   - /home/runner/work/my-namespace/my-project/node_modules/deep-map/lib/deep-map.js
   - /home/runner/work/my-namespace/my-project/node_modules/deep-map/lib/index.js
   - /home/runner/work/my-namespace/my-project/node_modules/@theunderscorer/nx-semantic-release/src/config/apply-tokens.js
   - /home/runner/work/my-namespace/my-project/node_modules/@theunderscorer/nx-semantic-release/src/executors/semantic-release/semantic-release.js
   - /home/runner/work/my-namespace/my-project/node_modules/@theunderscorer/nx-semantic-release/src/executors/semantic-release/executor.js
   - /home/runner/work/my-namespace/my-project/node_modules/nx/src/config/schema-utils.js
   - /home/runner/work/my-namespace/my-project/node_modules/nx/src/command-line/run/executor-utils.js
   - /home/runner/work/my-namespace/my-project/node_modules/nx/src/command-line/run/run.js
   - /home/runner/work/my-namespace/my-project/node_modules/nx/bin/run-executor.js
   Pass --verbose to see the stacktrace.

As a workaround, I downgraded to 2.5.0, which works correctly.

@wallacer
Copy link

I just added es6-weak-map to my dev dependencies for now

@jan-molak
Copy link
Author

I just added es6-weak-map to my dev dependencies for now

Sure, that's another possible workaround.

@TheUnderScorer
Copy link
Owner

Hey @jan-molak!

Thanks for reporting it so quickly after release 😅. Should be fixed in v2.6.1

@jan-molak
Copy link
Author

You're welcome! Thanks for your fantastic work!

@jan-molak
Copy link
Author

Just tried 2.6.1 and it works great, thanks!

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

3 participants