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

can not cache extensionless URLs #8106

Closed
lucacasonato opened this issue Oct 24, 2020 · 3 comments
Closed

can not cache extensionless URLs #8106

lucacasonato opened this issue Oct 24, 2020 · 3 comments
Assignees
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@lucacasonato
Copy link
Member

master

/m/f/P/g/l/d/example ❯❯❯ rm -rf $DENO_DIR
/m/f/P/g/l/d/example ❯❯❯ deno cache https://cdn.dreg.dev/package/picomatch@2.2.2
(snip)
Check https://cdn.dreg.dev/package/picomatch@2.2.2
error: TS6054 [ERROR]: File 'https://cdn.dreg.dev/package/picomatch@2.2.2' has an unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.

1.4.6

/m/f/P/g/l/d/example ❯❯❯ rm -rf $DENO_DIR
/m/f/P/g/l/d/example ❯❯❯ deno1.4.6 cache https://cdn.dreg.dev/package/picomatch@2.2.2
(snip)
Check https://cdn.dreg.dev/package/picomatch@2.2.2
(snip)
Found 144 errors.

cc @kitsonk

@kitsonk
Copy link
Contributor

kitsonk commented Oct 24, 2020

Ok, I think I might know what the problem is... working on a fix.

@kitsonk kitsonk self-assigned this Oct 24, 2020
@kitsonk kitsonk added bug Something isn't working correctly cli related to cli/ dir labels Oct 24, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Oct 24, 2020

So this is related to #8024, and the TypeScript compiler not liking root modules without extensions, even though dependencies can be. To make matters worse here, curl -I https://cdn.dreg.dev/package/picomatch@2.2.2 outputs:

HTTP/2 200 
content-length: 46854
content-type: application/javascript; charset=utf-8
x-typescript-types: /package/@types/picomatch@2.2.1
vary: Accept-Encoding
cross-origin-resource-policy: cross-origin
access-control-allow-origin: *
access-control-expose-headers: *
etag: W/"46854-2a3655872b129d67a3c5f3ac60c"
date: Sat, 24 Oct 2020 20:19:40 GMT
server: Fly/bca74ec (2020-10-19)
via: 2 fly.io

And as you point out it was "broken" in 1.4.6 as it was type checking JavaScript, which it shouldn't be doing.

@kitsonk
Copy link
Contributor

kitsonk commented Oct 28, 2020

It appears that #8114 has fixed this one.

> deno cache https://cdn.dreg.dev/package/picomatch@2.2.2
Download https://cdn.dreg.dev/package/picomatch@2.2.2
Download https://cdn.dreg.dev/polyfill/node/path.ts
Download https://cdn.dreg.dev/polyfill/node/process.ts
Download https://cdn.dreg.dev/package/picomatch@2.2.2/_/9ee23622.js
Download https://cdn.dreg.dev/package/@types/picomatch@2.2.1
Download https://cdn.dreg.dev/package/@types/picomatch@2.2.1/index.d.ts
Download https://deno.land/std@0.66.0/node/process.ts
Download https://deno.land/std@0.66.0/path/mod.ts
Download https://cdn.dreg.dev/package/@types/picomatch@2.2.1/parse.d.ts
Download https://cdn.dreg.dev/package/@types/picomatch@2.2.1/constants.d.ts
Download https://deno.land/std@0.66.0/path/separator.ts
Download https://deno.land/std@0.66.0/path/_constants.ts
Download https://deno.land/std@0.66.0/path/win32.ts
Download https://deno.land/std@0.66.0/path/posix.ts
Download https://deno.land/std@0.66.0/path/common.ts
Download https://deno.land/std@0.66.0/path/_interface.ts
Download https://deno.land/std@0.66.0/path/glob.ts
Download https://deno.land/std@0.66.0/node/_utils.ts
Download https://deno.land/std@0.66.0/path/_util.ts
Download https://deno.land/std@0.66.0/_util/assert.ts
Check https://cdn.dreg.dev/package/picomatch@2.2.2

It is successfully cached without errors now.

@kitsonk kitsonk closed this as completed Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
Development

No branches or pull requests

2 participants