Deno: error: Uncaught Error: Import 'https://...' failed: 404 Not Found

Created on 13 May 2020  路  5Comments  路  Source: denoland/deno

Issue:

When doing imports from url that has other dependency, deno import randomly fails on different files with 404 error. Although the file is available with .ts added at the end of url

Steps to reproduce:

In main.ts file

import { Observable } from "https://raw.githubusercontent.com/ReactiveX/rxjs/master/src/index.ts";

ran with deno run main.ts --allow-net

Output:
error: Uncaught Error: Import 'https://raw.githubusercontent.com/ReactiveX/rxjs/master/src/internal/util/EmptyError' failed: 404 Not Found
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async processImports ($deno$/compiler.ts:736:23)
    at async processImports ($deno$/compiler.ts:753:7)
    at async processImports ($deno$/compiler.ts:753:7)
    at async compile ($deno$/compiler.ts:1316:31)
    at async tsCompilerOnMessage ($deno$/compiler.ts:1548:22)
    at async workerMessageRecvCallback ($deno$/runtime_worker.ts:74:9)
Version:

deno --version

deno 1.0.0-rc3
v8 8.4.300
typescript 3.8.3

All 5 comments

Although the file is available with .ts added at the end of url

Deno doesn't automatically add .ts. The URLs have to actually have it.

This module isn't using JavaScript import/export but NodeJS ones.

This makes JavaScript try to resolve this
NodeJS export

Thus trying to get you this
https://raw.githubusercontent.com/ReactiveX/rxjs/master/src/internal/util/EmptyError

Which is invalid cause all JS imports must have a valid extension

@Soremwar Thanks for looking into this. I was not confident with this import and it was just a bit of test.
I am more curious as why it fails on different files on each run.

@JobaerAhamed They're fetched concurrently, I would think.

@JobaerAhamed If you need RxJS you could try the JavaScript version (not sure if it works, but might as well give it a try)

import * as pkg from 'https://cdn.pika.dev/rxjs@^6.5.4';

PD: You should probably close this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

kitsonk picture kitsonk  路  3Comments

metakeule picture metakeule  路  3Comments

JosephAkayesi picture JosephAkayesi  路  3Comments

benjamingr picture benjamingr  路  3Comments