Relative import path "oak/router" not prefixed with / or ./ or ../ and not in import map
I get the above message when attempting to deploy to Deno Deploy via github actions. The same does not occur when running locally with
deno run -A src/main.ts
.
deploy.yaml:
deno.json:
src/main.ts
I know what the error means and I've fixed it before in other cases. From what I can see my configuration is correct, so I'm trying to figure out why I might be getting it only in the action execution. Could anyone lend an eye? thanks3 Replies
I have figured out that explicitly adding the sub paths of the imports to my
deno.json
file seems to solve the issue, for example:
if I want to use oak/router
in main.ts, I have to add "oak/router": "jsr:@oak/oak@17.0.0/router",
to deno.json
(ontop of the already existing oak
import). This is weird, because locally I can just have the top level oak
import and deno automatically resolves jsr:@oak/oak@17.0.0/router
when I specify oak/router
. I wonder why this is different when deploying, perhaps something to do with deployctl
?I also got the same error, it happens in the deno versions above 2.1.4
@zing remove the
import-map:
entry in your deploy action. The deno.json
file is not an import map. It's likely that it tried to parse it as such, didn't find any import and the errored