kawarimidoll / denote

A minimal profile page generator for Deno Deploy
https://denote.deno.dev/denote
MIT License
17 stars 2 forks source link

[error] Deno.serveHttp(...) is not a function when denote serve ./denote.yml #2

Closed autoaim-jp closed 3 years ago

autoaim-jp commented 3 years ago

Error occurred and I can't access localhost:8080.

  1. exec denote serve ./denote.yml
  2. access localhost:8080 with browser(Safari)
  3. error occurred and process terminated.
[user@~/resource/denote]$denote serve ./denote.yml 
HTTP webserver running. Access it at: http://localhost:8080/
error: Uncaught (in promise) TypeError: Deno.serveHttp(...) is not a function or its return value is not async iterable
      for await (const { respondWith } of Deno.serveHttp(conn)) {
                                               ^
    at https://deno.land/x/denote@0.1.0/cli/serve.ts:91:48
    at runServer (https://deno.land/x/denote@0.1.0/cli/serve.ts:94:6)
    at async serve (https://deno.land/x/denote@0.1.0/cli/serve.ts:71:11)
    at async main (https://deno.land/x/denote@0.1.0/cli/denote.ts:86:54)
    at async https://deno.land/x/denote@0.1.0/cli/denote.ts:122:14
[user@~/resource/denote]$
kawarimidoll commented 3 years ago

Thank you for reporting. I think that is an error in old Deno. What does deno --version returns? If the version is less than 1.13.0, please run deno upgrade.

autoaim-jp commented 3 years ago

Thank you for your support. Problem was solved by upgrading deno that way.

upgraded from

[user@~/resource/denote]$deno --version
deno 1.12.2 (release, x86_64-apple-darwin)
v8 9.2.230.14
typescript 4.3.5

upgraded to

[user@~/resource/denote]$deno --version
deno 1.13.1 (release, x86_64-apple-darwin)
v8 9.3.345.11
typescript 4.3.5

and I can see my awesome page! Thank you.

I think we miss package.json's engines param. Or is there something like this configuration in Deno?

kawarimidoll commented 3 years ago

I think we miss package.json's engines param. Or is there something like this configuration in Deno?

Deno does not have package.json. So I added version check feature in Denote CLI 0.2.0. From this version, the error occurs when Denote runs in old Deno environments. I know you don't need it because you are already using Deno 1.13.1, but this may be useful other users.