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

Module '"util"' has no default export. #3622

Closed
6 tasks done
fubhy opened this issue Jun 19, 2023 · 3 comments
Closed
6 tasks done

Module '"util"' has no default export. #3622

fubhy opened this issue Jun 19, 2023 · 3 comments

Comments

@fubhy
Copy link
Contributor

fubhy commented Jun 19, 2023

Describe the bug

When enabling lib checks in a consuming application or library that uses vitest, but doesn't allow synthetic default imports you'll currently run into this error:

@vitest/utils/dist/index.d.ts(5,8): error TS1192: Module '"util"' has no default export

Reproduction

I think the issue is obvious but let me know if you think otherwise and I'm happy to produce a reproduction repo.

System Info

System:
    OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz
    Memory: 20.47 GB / 31.20 GB
    Container: Yes
    Shell: 3.6.1 - /usr/bin/fish
  Binaries:
    Node: 20.2.0 - ~/.asdf/installs/nodejs/20.2.0/bin/node
    Yarn: 1.22.19 - ~/.asdf/shims/yarn
    npm: 9.6.6 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Chrome: 113.0.5672.126
    Chromium: 114.0.5735.106
    Firefox: 113.0.2

Used Package Manager

pnpm

Validations

@fubhy
Copy link
Contributor Author

fubhy commented Jun 19, 2023

I opened #3621

@curran
Copy link

curran commented Jun 24, 2023

I'm experiencing this as well.

@curran
Copy link

curran commented Jun 24, 2023

Workaround for now until that change gets released - exclude the test files from type checking:

tsconfig.json

{
  "//": "gets rid of the error:  'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.'",
  "compilerOptions": {
    "jsx": "react-jsx"
  },
  "include": ["src/**/*"],
  "exclude": ["src/**/*.test.tsx", "src/**/*.test.ts"]
}

@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants