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

When importing wrong local files shows no error. #18065

Open
7 tasks done
OlegBrony opened this issue Sep 10, 2024 · 4 comments
Open
7 tasks done

When importing wrong local files shows no error. #18065

OlegBrony opened this issue Sep 10, 2024 · 4 comments

Comments

@OlegBrony
Copy link

Describe the bug

First, I feel like it should be a known issue, but I can't find it anywhere in issues or SO etc. but i refuse to believe I'm the only one who bring this app.

When I change import file I expect IDE to highlight the error - because the file does not exist. but instead there is no error about import. it reproduces with all files except ts, tsx.
Reproduce:

  1. go here - https://stackblitz.com/edit/vitejs-vite-gzxywq?file=src%2Fmain.ts
  2. check 3 and 4 lines.
image

I think it's related to this file /node_modules/vite/client.d.ts. in there are declared modules with specific files. maybe it should be written differently? or is it just me?

Reproduction

https://stackblitz.com/edit/vitejs-vite-gzxywq?file=src%2Fmain.ts

Steps to reproduce

No response

System Info

❯ npx envinfo --system --npmPackages '{vite,@vitejs/*,rollup}' --binaries --browsers
Need to install the following packages:
envinfo@7.13.0
Ok to proceed? (y) y
 
  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    vite: ^5.4.3 => 5.4.3

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Sep 10, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

TypeScript does not give us an easy way to do this: microsoft/TypeScript#40450
I guess it's possible to achieve this by writing a TypeScript plugin. But using a plugin has some UX issues too.

@OlegBrony
Copy link
Author

TypeScript does not give us an easy way to do this: microsoft/TypeScript#40450 I guess it's possible to achieve this by writing a TypeScript plugin. But using a plugin has some UX issues too.

so you say, that this is typescript related issue, not vite?

@sapphi-red
Copy link
Member

Yes. It cannot be solved by changing a code in this repository. A change to TypeScript or, making a TypeScript plugin is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants