Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't execute the tutorial in my machine #1

Open
rafaelcascalho opened this issue Mar 26, 2020 · 3 comments
Open

Can't execute the tutorial in my machine #1

rafaelcascalho opened this issue Mar 26, 2020 · 3 comments

Comments

@rafaelcascalho
Copy link

rafaelcascalho commented Mar 26, 2020

Hi Diogo! I've just followed your tutorial, but something seems to be going wrong.

Here is my github repo.
And here is the error message following the deno -A index.js:

Compile https://deno.land/x/oak/mod.ts
error TS2339: Property 'len' does not exist on type 'FileInfo'.

► https://deno.land/x/oak/send.ts:154:55

154   response.headers.set("Content-Length", String(stats.len));

Aditional info

OS: Ubuntu 19.10
deno 0.37.1
v8 8.2.308
typescript 3.8.3

It seems to me to be something from deno itself, but I could not found why. Can you give me a hand?

@diogosouza
Copy link
Owner

Hey Rafael,
I'm sorry for the delay on this.

I've cloned your project and the only thing is wrong is the Postgres connection. You're using port 5433 (invalid).

In order for the example to work, you need to have the database set up and properly working, with the database pre-created, ok?

Let me know if this fixed your problem. :)

@rafaelcascalho
Copy link
Author

Hey @diogosouza !
No problem, I'm also busy at times here haha

So, I tried changing the port in the database class but it did not work. Locally, I'm using postgres with docker-compose, here is my composer file

version: '3'

services:
  psql:
    image: postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: 'password'
    ports:
      - '5433:5432'
    volumes:
      - './data:/var/lib/postgres/data'

That's why I used the port 5433 instead of 5432, the default port is exposing the postgres in another container of another project.

The following screenshots show that I can connect to the database, which has the beers table

This first one is a connection test using the 5433 port
Screenshot from 2020-04-03 17-10-59

This second one shows the database with the beers table created
Screenshot from 2020-04-03 17-19-39

I don't seem to figure out what could be 😄 haha.

@diogosouza
Copy link
Owner

Hey man.. sorry the delay...

This is so weird 🤔

I've ran your code in my computer, and everything's working fine. I'm afraid that maybe something wrong may be happening between the Deno app and your Docker image.

Can you test the example with a local Postgres database? Instead of the Docker image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants