Open m0rphed opened 3 months ago
Hi @m0rphed, thanks for the issue report with detailed information. I think the reason your config isn't loaded correctly is because you don't specify deno.json
in your include
property. deployctl
respects your config and decides to not upload your deno.json to the build pipeline where dependency resolution happens using import maps declared in deno.json
if present.
So can you try again with the following change?
{
"imports": {
"hono": "jsr:@hono/hono@^4.5.2",
"@std/dotenv/load": "jsr:@std/dotenv/load"
},
"tasks": {
"start": "deno run --allow-net --allow-read --allow-env main.ts"
},
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "hono/jsx"
},
"deploy": {
"exclude": [".env"],
- "include": ["./jsons", "*.ts"],
+ "include": ["./jsons", "*.ts", "deno.json"],
"entrypoint": "./main.ts"
}
}
Yes, thank you!
I included deno.json
- "include": ["./jsons", "*.ts", "deno.json"],
and it now works, and all dependencies were imported successfully.
It was very unclear to me, that I needed to explicitly include deno.json
, maybe I misread the docs 😓
Glad your second attempt succeeded!
It was very unclear to me, that I needed to explicitly include deno.json, maybe I misread the docs 😓
I totally agree. I think what makes users particularly confused is this message line:
i Using config file 'C:\Users\morph\proj\pet-react-hono-currency\display-currency-widget\server\deno.json'
This is likely giving users wrong idea that import maps in deno.json
will be used in module resolution, although it's not the case. We definitely would like to improve or add messages to tell users that no import maps are found if they either explicitly specify deno.json
in the exclude
field, or don't include deno.json
in the include
field.
JFYI I've created a patch to improve messages when the import map is not included possibly against user's expectation. #326
Hi!
I am having troubles deploying Hono project (
deployctl 1.12.0
):maybe Deno Deploy does not fully read
"imports"
section inside mydeno.json
(?):main.ts:
I am getting:
Which is strange for me - because locally with
deno task start
it all runs just fine on Deno version:🦕 v1.45.4+8bab761
looks similar to #139