-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Cannot read property 'connect' of undefined #5733
Comments
Im having the same error when running test step in CI/CD from Gitlab. |
Same error when running test step in Github actions. |
I think It may be an error caused by 'pg' lib package. Some days ago was made an new release. I'll try a downgrade with 7.x.x version |
@tarcisiobruni Was this working previously in your project? I've just setup a new project, so unsure if it's something in that or something has changed for existing project. |
I downgraded to |
@michaeldever Yes, was working perfectly 5 days ago. Any positive behavior I'll report here. When I made my project lib dependencys in Package.Json, pg was ^7.12.x. |
@tarcisiobruni Thanks for letting me know, I can hold off digging through my code until I know if it's an issue or not so. FWIW, I tried |
@michaeldever , what version of NodeJs is running while tests has been executed? I try to rerun some tests job that in past resulted in sucess, but now, a got error. If all was currectly before, so, whats now? I checked my Ci/Cd config in .gitlab-ci.yml, and when I saw how the Node version were being downloaded (node:latest), I got an Eureka! Node 14 has been released some days ago. Doing downgrade to 12.16.2, now all jobs looks going weel again. Try this too. Waiting your results... |
@tarcisiobruni if we ever cross paths IRL, drinks are on me. Changed to |
Same problem here, running Node 12.8.1. |
I had the same issue and then managed to debug it down to the fact that I had some code that was disposing my connection prior to another TypeORM operation occurring. Worth looking at your code if this may be the culprit for some of you. The error message isn't exactly helpful in this regard. |
Are y'all still have this issue in Typeorm 0.2.27? & with using pg 8.0.3? |
0.2.29 typeorm Same issue in runtime. |
I have was the same problem, and the reason is local path in the migrations. I fix it trying change the local path. |
I had same problem. Turns out my connection was not even being established. Just added some logging and saw why the connection was failing. Turns out I was using wrong postgresql array syntax in one of my entities. Verify your connection is actually successful or catch and fix possible errors try {
await createConnection();
console.log('Database connection established!');
}
catch (err) {
console.error(err);
} |
Getting this with First couple of tests run fine, and then one errors with this, and then all the following tests run fine, but Jest doesn't exit because a |
am still facing issue - 'TypeError: Cannot read property 'connect' of undefined' versions am using :: node - v12.20.1 please help as its really urgent. I am fixing a high priority issue by researching around whether typeorm support dynamic connection via fetching db creds from aws secrets manager. I have successfully fetched it but now am looking into how we can retry the connection in case of newly fetched values. |
You're probably not connected. #7995 Might help |
Issue type:
[ ] question
[x ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[x ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x ]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
Configuration Options
Code
Error
The text was updated successfully, but these errors were encountered: