nuxt-vue3-google-signin icon indicating copy to clipboard operation
nuxt-vue3-google-signin copied to clipboard

Random "missing required parameter client_id" errors

Open simonmaass opened this issue 10 months ago • 28 comments

I really dont know what is happening... randomly i get "missing required parameter client_id" in console... one day it works.. the next it doesnt...

image

Any one else experiencing this... using this with nuxt 3

simonmaass avatar Aug 11 '23 16:08 simonmaass

I am also experiencing the same thing in local. Had to restart the build for it to work. Haven't deployed to uat/staging but if this happens it can be concerning...

pokaiCheng avatar Aug 13 '23 13:08 pokaiCheng

Can you provide an example? this seems to be an bug

kasvith avatar Aug 13 '23 16:08 kasvith

I followed exact steps in the instructions, adding the module and adding googleSignIn.clientId

However, like simonmaaas said, sometimes it works, sometimes it doesn't. Mine seems to not work on first build, then had to stop everything and restart then it works fine. So very difficult to replicate the bug.

Just a question, I looked at the code file plugin.ts, and it's getting the signin from: const { googleSignIn } = useRuntimeConfig().public

So shouldnt the googlesignin not be inside public? So would the nuxt.config.ts be: modules: [ 'nuxt-vue3-google-signin' ], public: { googleSignIn: { clientId: 'CLIENT ID OBTAINED FROM GOOGLE API CONSOLE', } }

But like I mentioned, it is working but for me just on first build it doesnt.

pokaiCheng avatar Aug 13 '23 17:08 pokaiCheng

its picking up the config from nuxt config here and injecting it to runtime

https://github.com/wavezync/nuxt-vue3-google-signin/blob/8b6af9f251e648566a32b38dbe1f6aad24d87b84/src/module.ts#L43-L45

can you specify nuxt versions? so i can take a look

kasvith avatar Aug 13 '23 17:08 kasvith

@pokaiCheng @simonmaass

can you share a example repo with nuxt3 using your exact configuration for the plugin?

kasvith avatar Aug 13 '23 18:08 kasvith

@kasvith Vue 3.3.4, nuxt 3.6.5

Unfortunately I don't have an example repo. I'll see if I can build a simple repo with same configs and see if I can replicate the error.

pokaiCheng avatar Aug 13 '23 20:08 pokaiCheng

It would be nice to have a example repo with your exact configuration

kasvith avatar Aug 14 '23 13:08 kasvith

i am using the same versions as @pokaiCheng and also my config is as described above...

simonmaass avatar Aug 15 '23 12:08 simonmaass

Can you please provide a repo with your exact configuration related to the project

That would help me to understand whats the problem

kasvith avatar Aug 15 '23 12:08 kasvith

I've created a branch from your working example and changed the configs and package to match my versions. Very difficult to replicate the bug but sometimes the bug appears. What I did is switching between branches: one with the googleSignIn.clientId in the nuxt.config and one doesn't, then sometimes the bug will appear. Here's my branch: https://github.com/pokaiCheng/nuxt-vue3-google-signin-example/tree/missing-required-parameter-client-id

image

pokaiCheng avatar Aug 15 '23 20:08 pokaiCheng

Thanks @pokaiCheng will take a look

kasvith avatar Aug 16 '23 04:08 kasvith

we still have it and we really dont know what to do....

simonmaass avatar Aug 24 '23 11:08 simonmaass

Hi @simonmaass i didn't have time for looking at this, i will give an update

kasvith avatar Aug 24 '23 11:08 kasvith

Hi, do you have any updates please ?

zola33dsf avatar Oct 25 '23 13:10 zola33dsf

@zola33dsf unfortunately i couldn't reproduce this yet. would you share a repo which i can reproduce this?

kasvith avatar Oct 25 '23 13:10 kasvith

Yes @kasvith It is random so if it's not happening the first time you can try to refresh the page :

https://stackblitz.com/edit/github-7tvhqt?file=nuxt.config.ts,app.vue

You need to open the developper tools to see the error warning in the console

zola33dsf avatar Oct 25 '23 13:10 zola33dsf

Hi @zola33dsf I could reproduce this, seems something is wrong with the injection symbol.

kasvith avatar Oct 25 '23 13:10 kasvith

After upgrading to the new release of Nuxt 3.8.1, it seems that the problem has disappeared.

zola33dsf avatar Nov 06 '23 14:11 zola33dsf

Thanks for report @zola33dsf

Hi @simonmaass @pokaiCheng can you also check and verify this works in nuxt3.8.1 ?

kasvith avatar Nov 06 '23 16:11 kasvith

I opened a bug report in nuxt https://github.com/nuxt/nuxt/issues/24155

kasvith avatar Nov 06 '23 19:11 kasvith

Hi, after upgrading to the latest release of Nuxt 3.9.0 the issue came back..

zola33dsf avatar Dec 28 '23 09:12 zola33dsf

Just a question, I looked at the code file plugin.ts, and it's getting the signin from: const { googleSignIn } = useRuntimeConfig().public

So shouldnt the googlesignin not be inside public? So would the nuxt.config.ts be: modules: [ 'nuxt-vue3-google-signin' ], public: { googleSignIn: { clientId: 'CLIENT ID OBTAINED FROM GOOGLE API CONSOLE', } }

@pokaiCheng got a valid point see plugin.ts

But if we add it in runtimeConfig.public.googleSignIn that'll through exception of googleSigIn.clientId required.

@kasvith here is complete procedure to reproduce it. "nuxt": "^3.9.0", "nuxt-vue3-google-signin": "^0.0.10", 1.Take any nuxt app, upgrade it to latest for now it's 3.9.0 2. configure nuxt.config.ts

Or one can Change IAM_GOOGLE_CLIENT_ID to NUXT_PUBLIC_GOOGLE_CLIENT_ID as mentioned here

export default defineNuxtConfig({
   ...,
    modules: [
    'nuxt-vue3-google-signin',
  ],
  googleSignIn: {
    clientId: process.env.IAM_GOOGLE_CLIENT_ID,
  }
  });
  1. now remove node_modules and run npm i or npm ci and run npm run dev, after Nitro finishes build, visit server url e.g. http://localhost:3000/, in console you'll be able to see Error image

abdulla-iqbal avatar Dec 30 '23 10:12 abdulla-iqbal

Hi @abdulla-iqbal this seems an upstream issue with nuxt dev server, already created an issue there

kasvith avatar Dec 30 '23 10:12 kasvith

Is there any way to solve it ?

abdulla-iqbal avatar Dec 30 '23 10:12 abdulla-iqbal

Unfortunately we have to wait till Nuxt team to resolve this.

On Sat, Dec 30, 2023 at 4:03 PM Abdullah Iqbal @.***> wrote:

Is there any way to solve it ?

— Reply to this email directly, view it on GitHub https://github.com/wavezync/nuxt-vue3-google-signin/issues/11#issuecomment-1872501242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGCQC76QPFA4IF74ESWQPDYL7UXXAVCNFSM6AAAAAA3NDPREGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGUYDCMRUGI . You are receiving this because you were mentioned.Message ID: @.***>

kasvith avatar Dec 30 '23 10:12 kasvith

got it.

abdulla-iqbal avatar Dec 30 '23 10:12 abdulla-iqbal

Hi, do you have any updates please ?

zola33dsf avatar Jan 16 '24 16:01 zola33dsf

Hi @zola33dsf still waiting on nuxt team's update. it is a problem with upstream nuxt

kasvith avatar Jan 16 '24 16:01 kasvith