esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
3.14k stars 151 forks source link

querystring-es3 gets downloaded despite having a deno polyfill #127

Closed talentlessguy closed 3 years ago

talentlessguy commented 3 years ago

Related: #115

deno dowload logs:

Download http://localhost:8080/@tinyhttp/url
Download http://localhost:8080/v49/@tinyhttp/url@2.0.2/deno/url.js
Download http://localhost:8080/v49/@tinyhttp/url@2.0.2/dist/index.d.ts
Download http://localhost:8080/v49/querystring-es3@0.2.1/deno/querystring-es3.js
Download http://localhost:8080/v49/@types/node/querystring
Check file:///tmp/deno.ts
error: TS2305 [ERROR]: Module '"deno:///missing_dependency.d.ts"' has no exported member 'ParsedUrlQuery'.
import { ParsedUrlQuery } from '/v49/@types/node/querystring';
         ~~~~~~~~~~~~~~
    at http://localhost:8080/v49/@tinyhttp/url@2.0.2/dist/index.d.ts:1:10

esm.sh server logs:

2021/09/10 11:56:44 [debug] nodejs v14.17.6 installed, registry: https://registry.npmjs.org/
2021/09/10 11:56:44 [debug] Server ready on http://localhost:8080
2021/09/10 11:56:44 [debug] Testing page at http://localhost:8080?test
[debug] cjs lexer server ready on http://localhost:8088
2021/09/10 11:56:46 [debug] get npm package(@tinyhttp/url@2.0.2) info in 251.993172ms
2021/09/10 11:56:48 [debug] yarn add @tinyhttp/url@2.0.2 in 1.269438064s
2021/09/10 11:56:48 [debug] get npm package(querystring-es3@0.2.1) info in 121.614301ms
2021/09/10 11:56:48 [debug] esbuild @tinyhttp/url@2.0.2 deno production in 125.249696ms
2021/09/10 11:56:48 [warn] copyDTS(@types/node/querystring): open /tmp/esm-build-2c5b5cc86934b349c6662c0b8e92ee40ff629bdc/node_modules/@types/node/querystring: no such file or directory
2021/09/10 11:56:48 [debug] copy dts /@tinyhttp/url@2.0.2/./dist/index.d.ts in 21.053117ms
2021/09/10 11:56:48 [debug] queue(@tinyhttp/url@2.0.2,deno) done in 1.420074756s
2021/09/10 11:56:48 [debug] get npm package(querystring-es3@0.2.1) info in 53.164238ms
2021/09/10 11:56:49 [debug] yarn add querystring-es3@0.2.1 in 453.759266ms
2021/09/10 11:56:50 [debug] esbuild querystring-es3@0.2.1 deno production in 558.918174ms
2021/09/10 11:56:50 [debug] queue(querystring-es3@0.2.1,deno) done in 1.803615068s
2021/09/10 11:56:51 [debug] get npm package(@types/node@16.9.1) info in 2.729847783s
2021/09/10 11:56:51 [debug] yarn add @types/node@16.9.1 in 873.612065ms
2021/09/10 11:56:51 [debug] queue(@types/node@16.9.1/querystring,deno) done in 878.338935ms
2021/09/10 11:56:51 [error] buildESM: Could not resolve "@types/node/querystring"
2021/09/10 11:57:09 [debug] yarn add @types/node@16.9.1 in 782.530752ms
2021/09/10 11:57:09 [debug] queue(@types/node@16.9.1/querystring,deno) done in 788.009234ms
2021/09/10 11:57:09 [error] buildESM: Could not resolve "@types/node/querystring"
talentlessguy commented 3 years ago

@ije any ideas how to fix this?

ije commented 3 years ago

the types @types/node/querystring need to be resovled

ije commented 3 years ago

it only works in nodejs

talentlessguy commented 3 years ago

@ije what do you mean only works in node.js? querystring package is already polyfilled by deno

ije commented 3 years ago

the polyfill works with ?no-check, but the d.ts file still import the @types/node/querystring

ije commented 3 years ago
Screenshot 2021-09-12 at 02 39 43
talentlessguy commented 3 years ago

@ije oh got you

should I file a separate issue for this?

talentlessguy commented 3 years ago

@ije looks like a separate issue? for typings

ije commented 3 years ago

seems this has be fixed in v50, pls check https://github.com/alephjs/esm.sh/blob/f03118af0369948d60c2af35fb0482782c259dad/test/node.types.test.ts#L2

talentlessguy commented 3 years ago

yep seems to be fixed, closing