Replies: 7 comments 6 replies
-
That error should include the line+column information to locate the issue in the file, if there is any. |
Beta Was this translation helpful? Give feedback.
-
Here is the full stack trace. Not seeing anything pertaining to the SQL file I'm using.
|
Beta Was this translation helpful? Give feedback.
-
Something doesn't make sense here, like the error doesn't correspond the SQL file. Best shot in such situations is to debug the code, see what's going wrong. |
Beta Was this translation helpful? Give feedback.
-
I've spent several hours attempting to debug whats going on with this and haven't made much progress. I've gone ahead and recreated the issue is a separate repo if you want to check that out. |
Beta Was this translation helpful? Give feedback.
-
I have looked at it. No issues with the query, and it is formatted without any issue. This is what I'm getting into the console:
The second part tells you what you need to know, see this. Basically, your database connection requires a valid password, or else it fails to connect to that database. |
Beta Was this translation helpful? Give feedback.
-
this is li
I have gotten this when I didn't have a .env in the past. The repo I provided doesn't have an env file. You will have to add your own credentials to the db/index.js file to get the database connection to work. My database is being connected. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'm getting the well-known warning: 'WARNING: Creating a duplicate QueryFile object for the same file -' and an error
when trying to use external SQL files on Nextjs.
I have followed the documentations and the examples provided but am getting this warning and the error.
Here is some context:
sql.js
users/route.js
queries/users/get_user_by_id.sql
I don't quite understand why I am getting the 'invalid query format' error. From what I can tell, my QueryFile is correct:
Beta Was this translation helpful? Give feedback.
All reactions