Closed retuerto closed 8 months ago
The new domains supported no-longer use the old 'stitch' name. You need to use http://europe-west1.gcp.realm.mongodb.com/ instead.
The config is also using version ^1.5.1 - you want to be using 2.0 at this point as that has all the new domains in.
How to do that? I just follow your code.
I think if you just update the package.json to say
"realm-web": "^2.0.0"
not
"realm-web": "^1.5.1"
It will fix this for you.
On Mon, 24 Oct 2022, 19:38 Raul Retuerto, @.***> wrote:
How to do that? I just follow your code.
— Reply to this email directly, view it on GitHub https://github.com/mongodb-developer/cloudflare-worker-rest-api-atlas/issues/8#issuecomment-1289439732, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB6CVSZJQSWANQMN3LBHWTWE3JQRANCNFSM6AAAAAARMIYQBQ . You are receiving this because you commented.Message ID: <mongodb-developer/cloudflare-worker-rest-api-atlas/issues/8/1289439732@ github.com>
Great, it works. But Now and trying to use it within a nuxt3 project, and I having this issue when deploying to cloudflare
Uncaught TypeError: Cannot read properties of undefined (reading 'name') at worker.js:9568:104 at worker.js:9573:6 at worker.js:10116:4 at worker.js:10117:3 [code: 10021]
I think it is related with how it is imported, since ( "type": "module") is not in the package.json of the nuxt project. Does it make sense? I am not an expert on JS
This is my package.json:
{ "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", "wrangler-dev": "wrangler dev ", "deploy": "wrangler publish" }, "devDependencies": { "@cloudflare/workers-types": "^3.16.0", "@cloudflare/wrangler": "^1.20.0", "@intlify/unplugin-vue-i18n": "^0.7.0", "@nuxtjs/tailwindcss": "^5.3.3", "@tsndr/cloudflare-worker-jwt": "^2.1.2", "@types/node": "^18.8.5", "nuxt": "^3.0.0-rc.12", "typescript": "^4.8.4", "vue-i18n": "^9.2.2", "wrangler": "2.0.29" }, "dependencies": { "@sentry/tracing": "^7.14.1", "@sentry/vue": "^7.14.1", "class-transformer": "^0.5.1", "firebase": "^9.10.0", "libphonenumber-js": "^1.10.13", "realm-web": "^2.0.0", "reflect-metadata": "^0.1.13", "typedi": "^0.10.0", "vue3-google-map": "^0.15.0" } }
And this is the just the code I am trying to upload:
import * as Realm from 'realm-web'
export default defineEventHandler(async (event) => { let App: Realm.App App = App || new Realm.App('cloudflare2-pzeoh') const token = 't9ci3RLjrryl3b5tpX0cqTiLI0Zaqou18NibXpQLM4GkPcNwkoKfrBltMKQgJbdb'
return 'OK' })
And I get the error above.
Fixed in the latest update I just did.
I am having this issue:
FetchError: request to https://europe-west1.gcp.stitch.mongodb.com/api/client/v2.0/app//auth/providers/api-key/login failed, reason: getaddrinfo ENOTFOUND europe-west1.gcp.stitch.mongodb.com.