-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
404 when importing type declaration files from pika.dev using Deno 1.0.2 #5876
Comments
Seeing the same thing in Deno 1.0.3:
|
@njbraun You could potentially migrate to jspm, which works for me:
|
I just triaged this issue - I can repeat the problem. Going to problematic url in the browser yields an HTTP 500 error:
CC @FredKSchott can you check if that's a problem on your side? |
@jamesseanwright what was your entry point for this case? I get HTTP 404 in the browser for this type declaration as well - this might be a bug in parsing after all... |
I'm now using |
While that does work:
There's no fetch any of the type definitions like what was happening w/ Pika. (Request Header: X-TypeScript-Types). A reasonable stop gap until Deno can provide better error handling when a dependency graph results in 404/500 dead ends. |
@njbraun There's a potential fix for that: // deps.ts
import * as jsNodeFetch from 'https://dev.jspm.io/node-fetch@2.6.0';
import { fetch as Fetch } from 'https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/aaf0e9573304fcaa1daef91484c2fc5cebdbbcd0/types/node-fetch/index.d.ts'
// the binding to use throughout your code
export const nodeFetch: Fetch = jsNodeFetch; Specific to your example, is there a reason you're pulling in |
@jamesseanwright I just tried running this example on latest master and it compiles without a problem - I think the problem was fixed #6000, but I'm gonna keep this issue open until 1.0.4 is released. |
I'll give it a whirl at some point in the next few days. Thanks for the update @bartlomieju! :) |
Not sure if I'm encountering same issue with the following import.
A slew of items are downloaded but fails with the following..
Tried on Deno 1.0.5, 1.0.4, 1.0.3. |
@SquareMesh I just run your example and found the problematic type declaration. Downloading https://cdn.pika.dev/-/@material-ui/core@v4.10.1-fc2SiMnxs3PyrtZEG3jY/dist=es2019,mode=types/Card/Card.d.ts yields: import * as React from '/-/react@v16.13.1-ByypZEPVPs6cpkpGdpQK/dist=es2019,mode=types/index.d.ts';
import { StandardProps } from '/../dist=es2019,mode=types/index.d.ts';
import { PaperProps } from '../Paper.d.ts';
export interface CardProps extends StandardProps<PaperProps, CardClassKey> {
/**
* If `true`, the card will use raised styling.
*/
raised?: boolean;
}
export type CardClassKey = 'root';
/**
*
* Demos:
*
* - [Cards](https://material-ui.com/components/cards/)
*
* API:
*
* - [Card API](https://material-ui.com/api/card/)
* - inherits [Paper API](https://material-ui.com/api/paper/)
*/
export default function Card(props: CardProps): JSX.Element; Notice the second import: I think that might be problem originating in Pika, @FredKSchott can you confirm that it's expected import specifier? |
Yup, we just fixed that bug this weekend. I updated to Deno v1.1.0 and all type imports now resolve successfully. Note that it looks like you need to have the "dom" lib added in your tsconfig from material-ui to compile properly. |
Thanks @FredKSchott! Closing as resolved. |
I am seeing a slightly different material-ui with deno 1.1.1 error: |
@Bidek56 that's a different problem, please open a separate issue |
I have the following source code:
Running on latest (1.0.2) yields:
FYI, the
http
andurl
packages do not exist on pika.dev. It seems like the request tries to get type definitions for all sub-dependencies, but fails if they do not exist.Possibly related to: #5029 #5726
@bartlomieju
Also possibly relating to: skypackjs/skypack-cdn#3 and skypackjs/skypack-cdn#8
The text was updated successfully, but these errors were encountered: