FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 921 forks source link

X-Typescript-Types file is blank #276

Closed shian15810 closed 4 years ago

shian15810 commented 4 years ago

curl -I -X GET https://cdn.pika.dev/wretch is getting the following header:

x-typescript-types: /-/wretch@v1.7.2-e1h0Jt5yrayo6YXT1yrl/dist=es2017,mode=types/index.d.ts

Further curl https://cdn.pika.dev/-/wretch@v1.7.2-e1h0Jt5yrayo6YXT1yrl/dist=es2017,mode=types/index.d.ts is actually getting a blank file, with the following header:

content-length: 0

However, wretch is actually providing "types": "./dist/index.d.ts" in its package.json.

FredKSchott commented 4 years ago

That's because curl https://cdn.pika.dev/-/wretch@v1.7.2-e1h0Jt5yrayo6YXT1yrl/dist=es2017,mode=types/index.d.ts is actually returning a 301 Redirect to the correct type file at "dist/index.d.ts". You can see this by opening that URL in your browser, and seeing it download the correct file.

Deno should be following these redirects, but if you were seeing an issue in Deno let me know!

shian15810 commented 4 years ago

@FredKSchott Thanks for the clarification, I didn't notice that redirection.

My scenario is that I'm not getting typescript type information in vscode, and I can just trace it down to that blank file. Now I know how to solve it. Thank you!

FredKSchott commented 4 years ago

Fantastic!