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

Node types are pulled accidentally by importing vite types #1459

Open
5 tasks done
minht11 opened this issue Feb 24, 2025 · 1 comment
Open
5 tasks done

Node types are pulled accidentally by importing vite types #1459

minht11 opened this issue Feb 24, 2025 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@minht11
Copy link

minht11 commented Feb 24, 2025

Describe the bug

See the same issue in different package Anber/wyw-in-js#33

I was investigating why node types are included in my project and came to cause being .wxt/types/imports.d.ts file, which imports for example:
const ContentScriptContext: typeof import('wxt/client')['ContentScriptContext']

And that file uses:

import { ContentScriptDefinition } from '../../types'

Which in turn imports:
import type * as vite from 'vite';

If we look at vite, it uses <reference types="node" /> which means any file importing it also gets the same types.

Image

The fix would be split vite types from client ones, so two are not mixed.

Reproduction

n/a

Steps to reproduce

Try using const timeout: number = setTimeout(() => {})

System Info

"wxt": "^0.19.27"

Used Package Manager

pnpm

Validations

@minht11 minht11 added the pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug label Feb 24, 2025
@aklinker1
Copy link
Collaborator

This was intended, but I can see why it would cause problems. Will try to fix post-v1.0!

@aklinker1 aklinker1 added bug Something isn't working and removed pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug labels Feb 25, 2025
@aklinker1 aklinker1 added this to the v1.1 milestone Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants