Query file not found || Connector not installed
abgonzalez93 opened this issue · comments
Environment
- Node version (
node -v
): 18.20.2 - npm version (
npm -v
): 10.5.2 - Latitude CLI version (
latitude --version
): 1.3.1 - Latitude project version (check
latitude.json
at the root of your project): 1.1.0 - OS: Ubuntu 22.04.3
- Browser: Firefox 125.0.2
- Database: MySQL
Actual Behaviour
After updating CLI and Latitude project to the newest versions and also, installing MySQL Connector with the following command
npm install --save @latitude-data/mysql-connector
I found new 2 errors on my project:
- Query file not found: Even though it was working before the update. It seems like Latitude is trying to get the SQL file from another directory inside .latitude folder
- Connector not installed:
I installed the connector (@latitude-data/mysql-connector)
So I don't get why CLI is telling me that the connector is not installed yet
hey @abgonzalez93
Let's look at the 2 issues separately.
Connector not installed
The watchers detect if the package is installed via the package.json that should be present in the root of your project. Could you confirm you have a package.json at the root of your project and that it has the mysql connector listed in the dependencies list? If not, please do add a package.json and run the npm install --save ...
connector from the root of your project
Query not found
The behaviour looks correct so I'm not sure what could be happening here. latitude dev
keeps the contents of the queries
folder in sync with the contents of .latitude/app/static/.latitude/queries
folder. I'm gonna try to reproduce the issue on my end and come back to you.
Root of the project is where the connectors should be installed, so it looks ok. Some more questions then, are you running latitude dev
from the terminal in the root of your project?
Ok looks good. I've been able to reproduce the query not found issue and will release a fix asap (today). In the meantime if this is critical i'd suggest to downgrade to a previous latitude version with latitude update
.
There is also an error in the previous version (1.0.1). It seems it's because of the MySQL connector:
/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/protocol/Parser.js:437
throw err; // Rethrow non-MySQL errors
^
TypeError: Cannot read properties of undefined (reading 'map')
at MysqlConnector.buildQueryParams (file:///home/antoniobueno/Analitica/fieldeas-demo/node_modules/@latitude-data/mysql-connector/dist/index.js:91:23)
at file:///home/antoniobueno/Analitica/fieldeas-demo/node_modules/@latitude-data/mysql-connector/dist/index.js:34:50
at Handshake.onConnect (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/Pool.js:64:7)
at Handshake. (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/Connection.js:526:10)
at Handshake._callback (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/Connection.js:488:16)
at Sequence.end (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Sequence.OkPacket (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/protocol/sequences/Sequence.js:92:8)
at Protocol._parsePacket (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/antoniobueno/Analitica/fieldeas-demo/node_modules/mysql/lib/protocol/Parser.js:43:10)Node.js v18.20.2
this is probably some incompatibility with the version of the connector you installed and the version of latitude you are trying to use. It will get fix as soon as I fix the original issue and you can get to using the latest version of latitude. PR is already opened.
@abgonzalez93 the patch is released if you could update cli and latitude project to latest versions the issue should be solved 🙏🏼
Everything working fine now.
We keep in touch!