Skip to content

TypeError: Cannot read property 'rows' of undefined #2

@akulebyakin

Description

@akulebyakin

Привет!

В видео https://www.youtube.com/watch?v=Lu1ziKbQYIQ есть ссылка на данный репозиторий и показывается пример работы сервера в докер-контейнере.
При скачивании контейнера (или создании своего контейнера на основе данного репозитория), сервер завершает работу с ошибкой.

docker run -it -p 3000:3000 drucoder/web-server

`Unable to find image 'drucoder/web-server:latest' locally
latest: Pulling from drucoder/web-server
89d9c30c1d48: Pull complete
94a3280d4b7b: Pull complete
Digest: sha256:973e9937fbb735296f73061f2589fbb62bcb933a67d90a85c3dd30c5e3e80599
Status: Downloaded newer image for drucoder/web-server:latest

yarn run v1.16.0
$ micro
micro: Accepting connections on port 3000
(node:26) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
(node:26) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
micro: Gracefully shutting down. Please wait...
/docker-site/index.js:38
if (!result.rows[0].exists) {
^

TypeError: Cannot read property 'rows' of undefined
at Query.client.query [as callback] (/docker-site/index.js:38:17)
at Query.handleError (/docker-site/node_modules/pg/lib/query.js:142:17)
at process.nextTick (/docker-site/node_modules/pg/lib/client.js:63:13)
at process._tickCallback (internal/process/next_tick.js:61:11)`

И, кстати, спасибо большое за видео!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions