Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random "missing required parameter client_id" errors #11

Open
simonmaass opened this issue Aug 11, 2023 · 32 comments
Open

Random "missing required parameter client_id" errors #11

simonmaass opened this issue Aug 11, 2023 · 32 comments
Assignees
Labels
bug Something isn't working triage

Comments

@simonmaass
Copy link

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

@pokaiCheng
Copy link

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...

@kasvith
Copy link
Collaborator

kasvith commented Aug 13, 2023

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

@pokaiCheng
Copy link

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.

@kasvith
Copy link
Collaborator

kasvith commented Aug 13, 2023

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

nuxt.options.runtimeConfig.public.googleSignIn = {
clientId: options.clientId
}

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

@kasvith
Copy link
Collaborator

kasvith commented Aug 13, 2023

@pokaiCheng @simonmaass

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

@pokaiCheng
Copy link

@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.

@kasvith
Copy link
Collaborator

kasvith commented Aug 14, 2023

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

@simonmaass
Copy link
Author

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

@kasvith
Copy link
Collaborator

kasvith commented Aug 15, 2023

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

That would help me to understand whats the problem

@pokaiCheng
Copy link

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

@kasvith
Copy link
Collaborator

kasvith commented Aug 16, 2023

Thanks @pokaiCheng will take a look

@kasvith kasvith added bug Something isn't working triage labels Aug 21, 2023
@kasvith kasvith self-assigned this Aug 21, 2023
@simonmaass
Copy link
Author

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

@kasvith
Copy link
Collaborator

kasvith commented Aug 24, 2023

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

@zola33dsf
Copy link

Hi, do you have any updates please ?

@kasvith
Copy link
Collaborator

kasvith commented Oct 25, 2023

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

@zola33dsf
Copy link

zola33dsf commented Oct 25, 2023

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

@kasvith
Copy link
Collaborator

kasvith commented Oct 25, 2023

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

@zola33dsf
Copy link

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

@kasvith
Copy link
Collaborator

kasvith commented Nov 6, 2023

Thanks for report @zola33dsf

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

@kasvith
Copy link
Collaborator

kasvith commented Nov 6, 2023

I opened a bug report in nuxt nuxt/nuxt#24155

@zola33dsf
Copy link

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

@abdulla-iqbal
Copy link

abdulla-iqbal commented Dec 30, 2023

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

@kasvith
Copy link
Collaborator

kasvith commented Dec 30, 2023

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

@abdulla-iqbal
Copy link

Is there any way to solve it ?

@kasvith
Copy link
Collaborator

kasvith commented Dec 30, 2023 via email

@abdulla-iqbal
Copy link

got it.

@zola33dsf
Copy link

Hi, do you have any updates please ?

@kasvith
Copy link
Collaborator

kasvith commented Jan 16, 2024

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

@mpizman
Copy link

mpizman commented Sep 24, 2024

Hey, are there any updates? I have this issue using nuxt: 3.13.0 and nuxt-vue3-google-signin: 0.0.11
@kasvith

@kasvith
Copy link
Collaborator

kasvith commented Sep 24, 2024

hey i didn't have much time to take a look, would you be able to open a PR?

@davehague
Copy link

Hey all, thanks for the thread. I just confirmed that downgrading from "nuxt": "^3.13.2" (latest) to "nuxt": "3.12.4" fixed the issue. That doesn't help fix it going forward, but at least it's a workaround for those having the problem. I think this issue is related too, that was actually the error I was getting but found the answer to my problem here.

@MacMillan13
Copy link

MacMillan13 commented Nov 6, 2024

@davehague The "3.12.4" version doesn't fix the issue for me. It's working for me when I'm in the dev mode but it doesn't work for the prod build for some reason..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

8 participants