harlan-zw / nuxt-link-checker

Find and magically fix links that may be negatively effecting your Nuxt sites SEO.
https://nuxtseo.com/link-checker
84 stars 10 forks source link

Property 'hot' does not exist on type 'ImportMeta' #35

Closed P4sca1 closed 1 month ago

P4sca1 commented 1 month ago

Describe the bug

After installing the @nuxtjs/seo module including nuxt-link-checker@3.0.2, I get the following error when running nuxt build with typescript.typeCheck set to "build":

ℹ ✓ 2147 modules transformed.                                                                                                                 12:33:35 AM
computing gzip size (120)...node_modules/.pnpm/nuxt-link-checker@3.0.2_magicast@0.3.4_rollup@4.18.1_vite@5.3.4_@types+node@20.14.11_terser@5_3bsdi4zsktgzjx4j3xmrc5j55a/node_modules/nuxt-link-checker/dist/runtime/nuxt/plugin/view/Main.vue:19:17 - error TS2339: Property 'hot' does not exist on type 'ImportMeta'.

19 if (import.meta.hot) {
                   ~~~

node_modules/.pnpm/nuxt-link-checker@3.0.2_magicast@0.3.4_rollup@4.18.1_vite@5.3.4_@types+node@20.14.11_terser@5_3bsdi4zsktgzjx4j3xmrc5j55a/node_modules/nuxt-link-checker/dist/runtime/nuxt/plugin/view/Main.vue:20:15 - error TS2339: Property 'hot' does not exist on type 'ImportMeta'.

20   import.meta.hot.on('vite:afterUpdate', () => {
                 ~~~

node_modules/.pnpm/nuxt-link-checker@3.0.2_magicast@0.3.4_rollup@4.18.1_vite@5.3.4_@types+node@20.14.11_terser@5_3bsdi4zsktgzjx4j3xmrc5j55a/node_modules/nuxt-link-checker/dist/runtime/nuxt/plugin/view/Main.vue:42:38 - error TS2551: Property 'value' does not exist on type 'string'. Did you mean 'valueOf'?

42       :highlighted="highlightedLink?.value === node.link"
                                        ~~~~~

  node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es5.d.ts:529:5
    529     valueOf(): string;
            ~~~~~~~~~~~~~~~~~~
    'valueOf' is declared here.

Found 3 errors in the same file, starting at: node_modules/.pnpm/nuxt-link-checker@3.0.2_magicast@0.3.4_rollup@4.18.1_vite@5.3.4_@types+node@20.14.11_terser@5_3bsdi4zsktgzjx4j3xmrc5j55a/node_modules/nuxt-link-checker/dist/runtime/nuxt/plugin/view/Main.vue:19

Reproduction

No response

System / Nuxt Info

No response

P4sca1 commented 1 month ago

Context: https://github.com/vitejs/vite/issues/416

I am using pnpm without shamefully hoisting and was able to resolve the Property 'hot' does not exist on type 'ImportMeta' issue by installing vite in the root level. The second type issue remains:

node_modules/.pnpm/nuxt-link-checker@3.0.2_magicast@0.3.4_rollup@4.18.1_vite@5.3.4_@types+node@20.14.11_terser@5_3bsdi4zsktgzjx4j3xmrc5j55a/node_modules/nuxt-link-checker/dist/runtime/nuxt/plugin/view/Main.vue:42:38 - error TS2551: Property 'value' does not exist on type 'string'. Did you mean 'valueOf'?

42       :highlighted="highlightedLink?.value === node.link"
                                        ~~~~~

  node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es5.d.ts:529:5
    529     valueOf(): string;
            ~~~~~~~~~~~~~~~~~~
    'valueOf' is declared here.

Found 1 error in node_modules/.pnpm/nuxt-link-checker@3.0.2_magicast@0.3.4_rollup@4.18.1_vite@5.3.4_@types+node@20.14.11_terser@5_3bsdi4zsktgzjx4j3xmrc5j55a/node_modules/nuxt-link-checker/dist/runtime/nuxt/plugin/view/Main.vue:42