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

Errors occured while using vitepress-plugin-git-changelog. #172

Closed
Glomzzz opened this issue Apr 16, 2024 · 6 comments
Closed

Errors occured while using vitepress-plugin-git-changelog. #172

Glomzzz opened this issue Apr 16, 2024 · 6 comments
Labels
question Further information is requested

Comments

@Glomzzz
Copy link
Contributor

Glomzzz commented Apr 16, 2024

I followed https://nolebase-integrations.ayaka.io/pages/en/integrations/vitepress-plugin-git-changelog/getting-started.html

$ pnpm docs:dev

> @ docs:dev D:\git\glom\Librorum
> vitepress dev docs


  vitepress v1.1.0

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h to show help
17:42:39 [vitepress] Pre-transform error: Failed to resolve import "virtual:nolebase-git-changelog" from "node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/client/components/Contributors.vue". Does the file exist?
17:42:39 [vitepress] Pre-transform error: Failed to resolve import "virtual:nolebase-git-changelog" from "node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/client/components/Contributors.vue". Does the file exist? (x2)
17:42:39 [vitepress] Pre-transform error: Failed to resolve import "virtual:nolebase-git-changelog" from "node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/client/components/Changelog.vue". Does the file exist?
17:42:39 [vitepress] Pre-transform error: Failed to resolve import "virtual:nolebase-git-changelog" from "node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/client/components/Changelog.vue". Does the file exist? (x2)
17:42:40 [vitepress] Internal server error: Failed to resolve import "virtual:nolebase-git-changelog" from "node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/client/components/Contributors.vue". Does the file exist?
  Plugin: vite:import-analysis
  File: D:/git/glom/Librorum/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@nolebase/vitepress-plugin-git-changelog/dist/client/components/Contributors.vue:4:22
  1  |  import { defineComponent as _defineComponent } from "vue";
  2  |  import { inject, onMounted, onServerPrefetch, ref } from "vue";
  3  |  import Changelog from "virtual:nolebase-git-changelog";
     |                         ^
  4  |  import { useRawPath } from "../composables/path";
  5  |  import { useCommits } from "../composables/commits";
      at formatError (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:50877:46)
      at TransformContext.error (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:50871:19)
      at normalizeUrl (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:66110:33)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:66265:47
      at async Promise.all (index 2)
      at async TransformContext.transform (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:66186:13)
      at async Object.transform (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:51186:30)
      at async loadAndTransform (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:53941:29)
      at async viteTransformMiddleware (file:///D:/git/glom/Librorum/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-_QLjGPdL.js:63793:32)

Env: Windows 11
Whats going on there?

@nekomeowww nekomeowww added the question Further information is requested label Apr 16, 2024
@Glomzzz
Copy link
Contributor Author

Glomzzz commented Apr 16, 2024

Sure, i did it.
Here is my vite.config.ts

import { defineConfig } from 'vite'
import {
    GitChangelog,
    GitChangelogMarkdownSection,
} from '@nolebase/vitepress-plugin-git-changelog/vite'

export default defineConfig(async () => {
    return {
        plugins: [
            GitChangelog({
                repoURL: () => 'https://github.com/Glomzzz/Librorum',
            }),
            GitChangelogMarkdownSection({
              getChangelogTitle: (): string => {
                return '文件历史'
              },
              getContributorsTitle: (): string => {
                return '贡献者'
              },
              excludes: [
                'index.md',
              ],
            })
        ]
    }
}) 

@Glomzzz
Copy link
Contributor Author

Glomzzz commented Apr 16, 2024

btw, i tried running it on Linux(CentOS 9), but in vain

@Glomzzz
Copy link
Contributor Author

Glomzzz commented Apr 16, 2024

@Glomzzz
Copy link
Contributor Author

Glomzzz commented Apr 16, 2024

I guess I missed something, but i have no idea about that.

@Glomzzz
Copy link
Contributor Author

Glomzzz commented Apr 17, 2024

Ok, my vite.config.ts wasn't loaded correctly, I solved it by creating a new vite project.

The plugin is running perfectly right now, thanks.

@Glomzzz Glomzzz closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants