here is says client version 1.9.0 and not 1.12.0
I mean for when it doesnât work with your self hosted server to look in the payload, not for when it works with your moralis server
here is says client version 1.9.0 and not 1.12.0
I mean for when it doesnât work with your self hosted server to look in the payload, not for when it works with your moralis server
The screenshot are with the local server. And I guess the 1.9 version is from the package.json
"moralis": "^1.9.0",
And I canât change it, since moralis v1.12.0 doesnât exists. I can only change the moralis-v1 to the new patch, but I already did that.
"moralis-v1": "^1.12.0",
can you try to build again in an empty folder? in case that there is some cached package from the past
this is the file where you have to add that patch server side:
The latest [email protected]
seems to have fixed this issue.
You need to install [email protected]
in order for it to use moralis-v1
instead of moralis
.
And then uninstall the older [email protected]
.
If youâre using any imports from Moralis in your code e.g. import Moralis from 'moralis'
then you would just change moralis
to moralis-v1
.
Thanks, this worked. But one extra issue popped up, all GET data request are now returning error 1. When I call any other request everything works fine, but when I try to fetch any data from DB I get an error.
Can you post this code where you try to fetch data.
And this happened only after you updated to [email protected]
?
I am not getting that issue when querying my parse
database with similar code. Can you try with a simpler query e.g. without the equalTo
and try querying a different class like UserListings.
Yes, it only started after I switched from moralis
to moralis-v1
. And it keep happening with all queries, even the simple ones. Whatâs strange is that the error is only prompted when I request valid data, but when I request data thatâs not in the DB, no errors come up, and I get a valid response {"results":[]}
what do you see as payload and response if you look in browser network tab?
does it work with another table?
that User table has restrictions like ACL CLP?
Yes, the same is for all tables. Iâm not sure about the restrictions thou, how would I check them?
if you install parse dashboard then you will get an interface similar to how moralis database dashboard looks like and you can see the tables there and set/edit the permissions
For anyone dealing with this problem in the future.
Solved the MongoDB fetch problem by recreating the tables again via Moralis API.
Hi, long time no see, hope youâre doing amazing,
Iâve been following documentation and forum for the related problems but
I canât pass that { error: unauthorized }
problem,
I did so far:
[email protected]
at client app and ensured that all files which I imported moralis updated,yarn build
again.yarn dev
_
Issues:
http://localhost:1337/server/functions/getServerTime
like I used to see at appId.moralis.server:2053/server/functions/
unauthorized
_
Most of the answers to the same issue in the forum was about Application ID value which is correct for both database and clientâs APPLICATION_ID
Where else should I check, please?
look in network tab when a request is made to see if that app id is sent there and if it is sent if it has the expected value, alternatively you can patch the parse server to ignore the app id check for cloud functions
Sorry I canât see anyplace to check appid. (I mentioned some more results below the ss. )
_
Btw, client app connected to the database, after applying the patch; now the error turned into something from parse-server.
error: TypeError: Cannot read properties of undefined (reading 'type') {"code":1,"stack":"Error: TypeError: Cannot read properties of undefined (reading 'type')\n at /home/wagmi/Projects/mymoralisapp/mymoralisapp-migrating/database-setup/node_modules/parse-server/src/Controllers/DatabaseController.js:1310:27\n at processTicksAndRejections (node:internal/process/task_queues:96:5)"}
{
"name": "demo-parse-server-migration",
"version": "1.1.0",
"main": "dist/index.js",
"private": true,
"dependencies": {
"@codemirror/language": "^0.20.0",
"@moralisweb3/common-core": "^2.14.3",
"@moralisweb3/common-evm-utils": "^2.14.3",
"@moralisweb3/parse-server": "2.14.3",
"cors": "^2.8.5",
"dotenv": "^16.0.1",
"envalid": "7.3.1",
"express": "^4.18.2",
"express-rate-limit": "^6.5.1",
"graphql": "^16.6.0",
"graphql-ws": "^5.10.1",
"moralis": "^2.14.3",
"ngrok": "^4.3.3",
"parse-server": "^5.4.0"
},
"devDependencies": {
"@moralisweb3/eslint-config": "^1.0.2",
"@types/cors": "^2.8.13",
"@types/jest": "^29.2.5",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"axios": "^1.2.1",
"eslint": "^8.32.0",
"eslint-plugin-etc": "^2.0.2",
"eslint-plugin-import": "^2.27.5",
"jest": "^29.3.1",
"mongodb-runner": "^4.9.0",
"prettier": "^2.8.0",
"ts-jest": "^29.0.4",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
},
"scripts": {
"dev": "ts-node src/index.ts",
"start": "node build/index.js",
"build": "tsc",
"lint": "eslint --ext .js,.ts .",
"format": "prettier --write 'src/**/*.{js,ts}'",
"dev:db-start": "mongodb-runner start",
"dev:db-stop": "mongodb-runner stop",
"gen:cloud": "ts-node ./scripts/generateCloudCode.ts",
"tsc": "tsc"
}
}
what patch did you apply?
you have to look in the payload of the request that is made to the server, it will not work if you access that url directly in the browser unless you patch the server code to skip the app id check for cloud functions