Skip to content

Upgrading to 0.10.1 causes "Cannot find global type" errors to appear #548

@cmcnicholas

Description

@cmcnicholas

Describe the bug

I upgraded our setup to 0.10.1 (we are using vue-tsc 2.2.12), immediately after I get the following error reports when running our project:

 ERROR(vue-tsc)  Cannot find global type 'Boolean'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'CallableFunction'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'Function'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'IArguments'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'NewableFunction'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'Number'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'Object'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  Cannot find global type 'RegExp'.
 FILE  undefined:

undefined

 ERROR(vue-tsc)  File 'C:/xxx/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/lib.dom.d.ts' not found.
  The file is in the program because:
    Library 'lib.dom.d.ts' specified in compilerOptions
 FILE  undefined:

undefined

 ERROR(vue-tsc)  File 'C:/xxx/node_modules/vite-plugin-checker/dist/checkers/vueTsc/typescript-vue-tsc/lib/lib.esnext.d.ts' not found.
  The file is in the program because:
    Library 'lib.esnext.d.ts' specified in compilerOptions
 FILE  undefined:

undefined

our vite.config.ts looks like:

/// <reference types='vitest' />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import vue from '@vitejs/plugin-vue';
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';

export default defineConfig({
  root: __dirname,
  cacheDir: '../../node_modules/.vite/apps/portal',

  server: {
    port: 4202,
    host: 'localhost',
    hmr: false, // HMR is hanging
  },

  preview: {
    port: 4302,
    host: 'localhost',
  },

  plugins: [
    vue(),
    nxViteTsPaths(),
    checker({ vueTsc: { tsconfigPath: 'tsconfig.app.json' } }),
  ],

  css: {
    preprocessorOptions: {
      scss: {
        api: 'modern',
      },
    },
  },

  // Uncomment this if you are using workers.
  worker: {
    plugins: () => [nxViteTsPaths()],
  },

  build: {
    outDir: '../../dist/apps/portal',
    sourcemap: true,
    reportCompressedSize: true,
    commonjsOptions: {
      transformMixedEsModules: true,
    },
  },

  test: {
    globals: true,
    cache: {
      dir: '../../node_modules/.vitest/apps/portal',
    },
    environment: 'jsdom',
    include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],

    reporters: ['default'],
    coverage: {
      reportsDirectory: '../../coverage/apps/portal',
      provider: 'v8',
    },
  },
});

Downgrading the project fixed the issue.

Reproduction

Upgrade a project from 0.10.0 to 0.10.1

Expected behavior

No errors/warnings.

System Info

The following is after downgrade to 0.10.0

  System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
    Memory: 8.92 GB / 31.68 GB
  Binaries:
    Node: 22.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (137.0.3296.93)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    vite-plugin-checker: ^0.10.0 => 0.10.0

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions