qduld / vite-plugin-git-revision

Vite plugin that generates VERSION and COMMITHASH files during build based on a local git repository.
8 stars 11 forks source link

Error with Vue 2.7 #4

Open kjanusz opened 2 years ago

kjanusz commented 2 years ago

Hi,

i don't get the plugin to run. An idea what it might be about?

Note: I already understood that the plugin is for the Vue 3, but theoretically it would have to work with Vue 2.7, right?

My Setup on Mac macOS Monterey - Vue 2.7 ("vue": "^2.7.5" & "vite-plugin-git-revision": "^0.1.9" & "vite": "^2.9.14")

...
plugins: [
      vue(),
      GitRevision({
        lightweightTags: false,
        branch: true,
      }),
    ],`
 npm run dev

Error:

error when starting dev server:
TypeError: Cannot set properties of undefined (setting 'GITVERSION')
    at Object.config (/test/node_modules/vite-plugin-git-revision/dist/index.js:53:32)
    at resolveConfig (/test/node_modules/vite/dist/node/chunks/dep-c9998dc6.js:61491:33)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createServer (/test/node_modules/vite/dist/node/chunks/dep-c9998dc6.js:60105:20)
    at async CAC.<anonymous> (/test/node_modules/vite/dist/node/cli.js:688:24)
kjanusz commented 2 years ago

It seems to be the same mistake as the other tickets. I think the documentation is incomplete.