Closed dominikS007 closed 1 year ago
@dominikS007 It looks similar to a closed issue #842. Please go through it and try the diagnostics. If node test-basic-test.js
works for you after updating database connection info in file config.testConnectionStrings.json
, it is issue with NextJS which fails to load the odbc_bindings.node file and you need to debug bindigs.js to know the root cause. Thanks.
Hi @dominikS007, I'm facing the same issue. Were you able to resolve this? If so please let me know how you have resolved it. Thanks
@bimalkjha
Hello
So I wanted to implement the connection between the site that I am building and the server that I have to use, I started to build the website in Nextjs 13 using app router. When making some of the front end i wanted to connect it to the db, I have used the package before in a different project and it worked, that project used ExpressJS and there were no issues at all. Unfortunately this is not the case with NextJS. After installed the package with npm and tying to connect to the db and display the results in the API i get the following error,
Steps to Reproduce:
File 1
In the route.ts file add the following code
File 2
I have the correct connection string and sql query as I tried to just run it with the following command and it worked
To get the error now just have to go to the browser and type in
http://localhost:3000/api/db
and you should get the same error.Is there a way to resolve this issue or am i doing something wrong that I am not noticing?
The error that gets displayed in the console