Skip to content

vitepress-plugin-git-changelog is missing an explicit dependency on vite #617

@g-dx

Description

@g-dx

Currently, when installing @nolebase/vitepress-plugin-git-changelog @ v2.18.2 & using vitepress v2.0.0-alpha.17 gives the following error:

failed to load config from /Users/g-dx/workspace/docs/.vitepress/config.ts
failed to resolve config. error:
Cannot find package 'vite' imported from /Users/g-dx/workspacedocs/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/vite/index.mjs
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite' imported from /Users/g-dx/workspace/docs/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/vite/index.mjs
    at Object.getPackageJSONURL (node:internal/modules/package_json_reader:314:9)
    at packageResolve (node:internal/modules/esm/resolve:768:81)
    at moduleResolve (node:internal/modules/esm/resolve:855:18)
    at defaultResolve (node:internal/modules/esm/resolve:985:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:731:20)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:310:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:182:49)

Examination of the git changelog code shows that it imports vite:

https://github.com/nolebase/integrations/blob/main/packages/vitepress-plugin-git-changelog/src/vite/git.ts#L14

However, the package.json does not declare a devDependency or peerDependency on vite:

https://github.com/nolebase/integrations/blob/main/packages/vitepress-plugin-git-changelog/package.json

It therefore seems to have implicitly been relying on vitepress making vite available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions