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]: cspell crashes under pnpm due to undeclared dependency on @cspell/cspell-types #4639

Closed
5 of 19 tasks
Silic0nS0ldier opened this issue Jul 15, 2023 · 3 comments
Closed
5 of 19 tasks

Comments

@Silic0nS0ldier
Copy link

Info

Kind of Issue

  • runtime - command-line tools
  • building / compiling
  • security
  • change in behavior
  • crash / error

Which Tool or library

  • cspell -- the command-line spelling tool
  • cspell/eslint-plugin -- the plugin for ESLint
  • cspell-tools -- used for building dictionary files
  • cspell-lib -- library that does the actual spell checking.
  • cspell-trie -- tool for working with trie files.

Which Version

Version: 6.31.1

Issue with supporting library?

  • No
  • cspell-glob -- library for matching glob patterns
  • cspell-io -- thin file i/o library
  • cspell-trie-lib - trie lib
  • cspell-trie2-lib - trie lib alternate format

OS:

  • Macos
  • Linux
  • Windows
  • Other

version:

OS version if applicable.

Linux Raze 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Bug Description

Describe the bug

cspell has declared a devDependency on @cspell/cspell-types but uses this dependency published packages.

import { MessageTypes } from '@cspell/cspell-types';

Adding the following to package.json serves as a workaround.

    "pnpm": {
        "packageExtensions": {
            "cspell": {
                "dependencies": {
                    "@cspell/cspell-types": "6.31.1"
                }
            }
        }
    },

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/userfrosting/gulp-uf-bundle-assets
  2. Checkout commit 48bde93589f5d9e942d280faf355f8269bc5f6ac
  3. pnpm install (with v8.6.7 or have corepack enabled)
  4. pnpm run release-readiness
  5. See error
silicon@Raze:~/source/gulp-uf-bundle-assets$ pnpm run release-readiness

> @userfrosting/gulp-bundle-assets@5.0.3 release-readiness /home/silicon/source/gulp-uf-bundle-assets
> npm run release-readiness:cspell && npm run release-readiness:api-changes


> @userfrosting/gulp-bundle-assets@5.0.3 release-readiness:cspell
> cspell 'src/**' 'dist/**' 'docs/**' '*'

node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module '@cspell/cspell-types'
Require stack:
- /home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/lint/lint.js
- /home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/lint/index.js
- /home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/application.js
- /home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/commandCheck.js
- /home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/app.js
- /home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/bin.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:119:18)
    at Object.<anonymous> (/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/lint/lint.js:32:24)
    at Module._compile (node:internal/modules/cjs/loader:1233:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/lint/lint.js',
    '/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/lint/index.js',
    '/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/application.js',
    '/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/commandCheck.js',
    '/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/dist/cjs/app.js',
    '/home/silicon/source/gulp-uf-bundle-assets/node_modules/.pnpm/cspell@6.31.1/node_modules/cspell/bin.js'
  ]
}

Node.js v20.4.0
 ELIFECYCLE  Command failed with exit code 1.

Expected behavior

CSpell (invoked by pnpm run release-readiness runs to completion without error.

Screenshots

NA

Additional context

Works fine in npm (and likely Yarn Classic) as @cspell/cspell-types is hoisted from another cspell package (cspell-dictionary, cspell-grammar, cspell-lib, cspell-trie-lib).

cspell.json

If applicable, attach a copy of the cspell.json file.

Example Repository (Optional)

NA

@Jason3S
Copy link
Collaborator

Jason3S commented Jul 15, 2023

@Silic0nS0ldier,

Thank you. I'll take a look.

Jason3S added a commit that referenced this issue Jul 15, 2023
Jason3S added a commit that referenced this issue Jul 15, 2023
Jason3S added a commit that referenced this issue Jul 15, 2023
Jason3S added a commit that referenced this issue Jul 16, 2023
@Jason3S
Copy link
Collaborator

Jason3S commented Jul 16, 2023

fixed in 6.31.2

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants