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

Possible bug (git-changelog) - Contributors.vue import error. Failed import md5. #124

Closed
Ampernic opened this issue Mar 26, 2024 · 8 comments · Fixed by #125
Closed

Possible bug (git-changelog) - Contributors.vue import error. Failed import md5. #124

Ampernic opened this issue Mar 26, 2024 · 8 comments · Fixed by #125
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Ampernic
Copy link
Contributor

Ampernic commented Mar 26, 2024

I'm trying to use @nolebase/vitepress-plugin-git-changelog form npm

When i try add this in vite.config.ts this

import { dirname, join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import UnoCSS from 'unocss/vite'
import { 
  GitChangelog,
  GitChangelogMarkdownSection 
} from '@nolebase/vitepress-plugin-git-changelog/vite'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

/* some other */ 

export default defineConfig({
  vite: {
    resolve: {
      alias: {
        '@nolebase/vitepress-plugin-git-changelog': resolve(__dirname, '/* path to npm package */ '),
      },
    },
    plugins: [
      UnoCSS(),
      GitChangelog({
        maxGitLogCount: 20000,
        repoURL: () => /* url */ ,
        rewritePaths: /* path */,
      }),
      GitChangelogMarkdownSection({
        getChangelogTitle: (_, __, { helpers }): string => {
          return /* title */
        },
        getContributorsTitle: (_, __, { helpers }): string => {
          return /* title */
        },
        excludes: [],
        exclude: (_, { helpers }): boolean => {
                /* some excludes or defauts, doesn't matter, this works normal */
        },
        sections: gitDisplay,
      }),
    ],
 /* another configs */
}

And add in theme/index.ts this:

import { 
  NolebaseGitChangelogPlugin
} from '@nolebase/vitepress-plugin-git-changelog/client'

/* some other imports */ 

export default {
  extends: DefaultTheme,
  Layout: () => {
    return h(DefaultTheme.Layout, null, {
      /* some own layout without using gitlog */ 
    })
  },
  enhanceApp(ctx) {
           /* some another plugins */ 
          ctx.app.use(NolebaseGitChangelogPlugin, {locales: /*locales*/ ,mapContributors: /* contibutors */ })
          enhanceAppWithTabs(ctx.app)
  },

I getting this in browser console:
изображение
изображение
but md5 and @types/md5 or another permutations of this is installed...

Where is the problem?
Everything is working on version 1.23.0 and older, where /components has .vue.d.ts files, but 1.24.0 and newer not working.

Tested on:
vitepress: 1.0.0 rc 43/1.0.0 rc 45/1.0.1
git-changelog: 1.24.0-1.25.0

@nekomeowww nekomeowww added the bug Something isn't working label Mar 26, 2024
@nekomeowww nekomeowww self-assigned this Mar 26, 2024
@nekomeowww
Copy link
Member

nekomeowww commented Mar 26, 2024

It's nice to meet you here. And apologize for the lack of documentations we are having now. 😫

Not sure where went wrong but one thing is clearly to be incorrect:

export default defineConfig({
  vite: {
    resolve: {
--      alias: {
--        '@nolebase/vitepress-plugin-git-changelog': resolve(__dirname, '/* path to npm package */ '),
--      },
    },
  },
}

Could you please try to remove the above configurations and try again?

For end users that import packages of Nolebase integrations from outside, no need to redirect @nolebase/vitepress-plugin-git-changelog or other @nolebase packages to node_modules/ since we have bundled everything everyone needs when publishing the modules.

@nekomeowww nekomeowww added question Further information is requested and removed bug Something isn't working labels Mar 26, 2024
@Ampernic
Copy link
Contributor Author

I tried this, but the picture remains the same

изображение

It's nice to meet you here. And apologize for the lack of documentations we are having now. 😫

Not sure where went wrong but one thing is clearly to be incorrect:

export default defineConfig({
  vite: {
    resolve: {
--      alias: {
--        '@nolebase/vitepress-plugin-git-changelog': resolve(__dirname, '/* path to npm package */ '),
--      },
    },
  },
}

Could you please try to remove the above configurations and try again?

For end users that import packages of Nolebase integrations from outside, no need to redirect @nolebase/vitepress-plugin-git-changelog or other @nolebase packages to node_modules/ since we have bundled everything everyone needs when publishing the modules.

@nekomeowww
Copy link
Member

Weird. Thanks for the feedbacks. Let me try to inspect my other VitePress sites to figure out.

@nekomeowww nekomeowww added the bug Something isn't working label Mar 26, 2024
@nekomeowww
Copy link
Member

I have identified and reproduced this issue. Let me quickly fix it.

@Ampernic
Copy link
Contributor Author

Ampernic commented Mar 26, 2024

Thank you for fix, but can i ask about this after update?

изображение

@nekomeowww
Copy link
Member

Let me see. This is probably caused by @nolebase/ui.

@Ampernic
Copy link
Contributor Author

Ampernic commented Mar 26, 2024

Let me see. This is probably caused by @nolebase/ui.

Thank you so much for fix <3
Everything works perfectly

@nekomeowww
Copy link
Member

Let me see. This is probably caused by @nolebase/ui.

Thank you so much for fix <3

Everything works perfectly

Sounds great! Thank you very much for feedbacks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
2 participants