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

Failed to run typecheck command in vitest test code #30962

Open
kazrael2119 opened this issue Aug 30, 2024 · 4 comments
Open

Failed to run typecheck command in vitest test code #30962

kazrael2119 opened this issue Aug 30, 2024 · 4 comments
Labels
dev-tool Issues related to the Azure SDK for JS dev-tool question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@kazrael2119
Copy link
Contributor

command: dev-tool run typecheck
package path: sdk\core\core-lro

error message:

$ dev-tool run typecheck
[typecheck] type-checking...
[typecheck] ../../../common/temp/node_modules/.pnpm/@types+chai@4.3.18/node_modules/@types/chai/index.d.ts:1:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: Message, ObjectProperty, ChaiPlugin, AssertionArgs, Operator, OperatorComparable, AssertionError, chai

1 declare namespace Chai {
  ~~~~~~~

  ../../../common/temp/node_modules/.pnpm/@vitest+expect@2.0.5/node_modules/@vitest/expect/dist/chai.d.cts:16:1
    16 declare namespace Chai {
       ~~~~~~~
    Conflicts are in this file.
../../../common/temp/node_modules/.pnpm/@vitest+expect@2.0.5/node_modules/@vitest/expect/dist/chai.d.cts:16:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: Message, ObjectProperty, ChaiPlugin, AssertionArgs, Operator, OperatorComparable, AssertionError, chai

16 declare namespace Chai {
   ~~~~~~~

  ../../../common/temp/node_modules/.pnpm/@types+chai@4.3.18/node_modules/@types/chai/index.d.ts:1:1
    1 declare namespace Chai {
      ~~~~~~~
    Conflicts are in this file.
../../../common/temp/node_modules/.pnpm/vite-node@2.0.5_@types+node@18.19.46/node_modules/vite-node/dist/index-CCsqCcr7.d.ts:88:14 - error TS2304: Cannot find name 'WebSocket'.

88   webSocket: WebSocket
                ~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vite-node@2.0.5_@types+node@18.19.46/node_modules/vite-node/dist/server.d.ts:1:10 - error TS2305: Module '"vite"' has no exported member 'TransformResult'.

1 import { TransformResult, ViteDevServer } from 'vite';
           ~~~~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vite-node@2.0.5_@types+node@18.19.46/node_modules/vite-node/dist/server.d.ts:1:27 - error TS2305: Module '"vite"' has no exported member 'ViteDevServer'.

1 import { TransformResult, ViteDevServer } from 'vite';
                            ~~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:10 - error TS2305: Module '"vite"' has no exported member 'ViteDevServer'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
           ~~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:25 - error TS2305: Module '"vite"' has no exported member 'TransformResult'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
                          ~~~~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:63 - error TS2305: Module '"vite"' has no exported member 'UserConfig'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
                                                                ~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:91 - error TS2305: Module '"vite"' has no exported member 'ConfigEnv'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
                                                                                            ~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:102 - error TS2305: Module '"vite"' has no exported member 'ServerOptions'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
                                                                                                       ~~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:117 - error TS2305: Module '"vite"' has no exported member 'DepOptimizationConfig'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
                                                                                                                      ~~~~~~~~~~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:4:140 - error TS2305: Module '"vite"' has no exported member 'AliasOptions'.

4 import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, ConfigEnv, ServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
                                                                                                                                             ~~~~~~~~~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:643:45 - error TS2503: Cannot find namespace 'vite'.

643     getModulesByFilepath(file: string): Set<vite.ModuleNode>;
                                                ~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:644:32 - error TS2503: Cannot find namespace 'vite'.

644     getModuleById(id: string): vite.ModuleNode | undefined;
                                   ~~~~
../../../common/temp/node_modules/.pnpm/vitest@2.0.5_@types+node@18.19.46_@vitest+browser@2.0.5/node_modules/vitest/dist/chunks/reporters.C_zwCd4j.d.ts:2675:16 - error TS2671: Cannot augment module 'vite' because it resolves to a non-module entity.

2675 declare module 'vite' {
                    ~~~~~~

[dev-tool] Errors occured. See the output above.

only remove "./test/**/*.ts" under include from tsconfig.json, this command could pass

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 30, 2024
@MaryGao MaryGao changed the title Failed to run typecheck command Failed to run typecheck command in vitest test code Aug 30, 2024
@MaryGao MaryGao added dev-tool Issues related to the Azure SDK for JS dev-tool and removed customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Aug 30, 2024
@MaryGao
Copy link
Member

MaryGao commented Aug 30, 2024

@jeremymeng it seems this is a general issue when we try to run typecheck in vitest. not sure we should just ignore this or any way we could fix it.

@jeremymeng
Copy link
Member

@MaryGao It's this issue vitest-dev/vitest#4688. Can you work around by adding "skipLibCheck": true to tsconfig.json?

@kazrael2119
Copy link
Contributor Author

skipLibCheck": true

It works with adding this config

@xirzec
Copy link
Member

xirzec commented Sep 6, 2024

/cc @mpodwysocki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tool Issues related to the Azure SDK for JS dev-tool question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants