Comments (15)
@yuqingc Yeah, I also find this problem, but the error message is An import path cannot end with a '.ts'
, this isn't the real problem, is it?
from deno.
@monkingxue that's because Deno cache the files and doesn't send a network request.. (look at ~/.deno/src
)
from deno.
Ok! I've could reproduce the error π
while you run make test
Deno uses a diffrent cache dir:
https://github.com/ry/deno/blob/180f0a1b3cfa0f7cd1f37485839c763de4d03693/integration_test.go#L73-L86
so it can't use this cached file later when you want to execute code by your self : (
so you should do:
cd $GOPATH/src/github.com/deno
http-server -p 4545
and then try the code again (deno testdata/006/...
), after that close your http-server
now you can try the code again and it should just work...
I'll close this issue as resolved : )
from deno.
@qti3e Reproduced this error and resolved this as you mentioned. thanks!
from deno.
It seems that this package is imported from a server. Since there is no server running at 4545 port on your local computer which serves the exact ts file, it might fail importing modules from that url.
from deno.
The server is up already, because the tests are pass before 06
, it seems like an issue about import on TypeScript.
from deno.
FYI; you'll see this in case of lack of server:
Downloading http://localhost:4545/testdata/subdir/print_hello.ts
/main.js:15737
throw _iteratorError;
^
TypeError: Cannot read property 'compileAndRun' of undefined
at ../runtime.ts:132:19
at Array.map (<anonymous>)
at localDefine (../runtime.ts:120:23)
at eval (/home/qti3e/go/src/deno/testdata/006_url_imports.ts, <anonymous>)
at Object.eval [as globalEval] (<anonymous>)
at execute (../runtime.ts:185:3)
at FileModule.compileAndRun (../runtime.ts:93:5)
at ../main.ts:50:9
at ../dispatch.ts:68:5
from deno.
@qti3e Yeah, if I run make test
, all of tests are ok because the test.go
will start a server. But when I use deno testdata/006_.....
, the error message isn't something about lacking of server, although I didn't start the server.
from deno.
@yorkie The tests before 006 don't use importing by url, so they can pass
from deno.
@monkingxue Can you provide the version of ts deno is using?
deno testdata/import_typescript.ts
from deno.
@qti3e Absolutely right, typescript version 2.8.3
.But I find the print_hello.ts
file in .deno/cache
rather than .deno/src
from deno.
@mohsen1 So error is not related to TypeScript version as I have the same version...
btw, the file should be in ~/.deno/src/localhost:4545/testdata/subdir/print_hello.ts
if it's not maybe the issue is related to this?
from deno.
@qti3e I have removed the cache file and src file, and just re-run the deno 006...
but it still told me that An import path cannot end with a '.ts' extension
from deno.
$ rm -rf ~/.deno/cache
$ rm -rf ~/.deno/src
$ deno testdata/006_url_imports.ts
Downloading http://localhost:4545/testdata/subdir/print_hello.ts
Downloading http://localhost:4545/testdata/subdir/print_hello.ts
Downloading http://localhost:4545/testdata/subdir/print_hello.ts
/Users/xueyingchen/Desktop/learn-one/go/src/github.com/ry/deno/testdata/006_url_imports.ts:1:28 - error TS2691: An import path cannot end with a '.ts' extension. Consider importing 'http://localhost:4545/testdata/subdir/print_hello' instead.
1 import { printHello } from "http://localhost:4545/testdata/subdir/print_hello.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ ls ~/.deno/cache
<empty>
$ ls ~/.deno/src
<empty>
from deno.
@qti3e, Yeah it's all right, but I think the error message should be lack of server
when I didn't run the server port 4545.
from deno.
Related Issues (20)
- Regression in `Deno.serve` when both `cert` and `key` are `undefined`
- Building a Deno.Kv backend in LMDB HOT 1
- Importing certain JSRs will not work with deno compile HOT 2
- Panic when passing wildcard to allow-net HOT 3
- Deno crashes (not a rust panic), when debugging a specific piece of code
- Drop Typescript
- Deno has panicked during upgrade on MacOS
- release v.1.43.0 missing assets HOT 1
- [node:worker_threads] The behavior of `MessagePort.on()` differs between Deno and Node.js
- node:fs/promises watcher polyfill is not AsyncIterable
- Tracking issue for using WebGPU to render on the window of the desktop environment HOT 3
- [node:worker_threads] `MessagePort` is lacking methods `off` and `removeListener`
- Support deno lockfile in projects with only `package.json`
- Cannot start inspector server: Os { code: 10048, kind: AddrInUse, message: "Only one usage of each socket address (protocol/network address/port) is normally permitted." } HOT 1
- Uncaught Error: Not implemented: udp.UDP.prototype.unref
- WebGPU: Implement copyExternalImageToTexture HOT 1
- Deno using memory even when i;m not running a file with deno
- Deno should make simultaneous outgoing requests to IPv4 and IPv6 addresses when both exist HOT 3
- Deno 1.43.0 fails hard upon encountering lockfile with no `integrity` field. HOT 5
- πUnable to connect sub-process standard input/output to a terminal with `Deno.Command`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno.