auth-module: $auth.loginWith() not working
Version
Reproduction link
https://codesandbox.io/s/nifty-shtern-4lbdo
Steps to reproduce
- Go to
/login - In console you will have the following warnings
./.nuxt/auth/schemes/oauth2.js 142:24-30 "export ‘default’ (imported as ‘nanoid’) was not found in ‘nanoid’ ./.nuxt/auth/schemes/oauth2.js 155:30-36 "export ‘default’ (imported as ‘nanoid’) was not found in ‘nanoid’
-
Click on login with google
-
In console you will see the following errors
TypeError: Object(…) is not a function [Vue warn]: Failed to mount component: template or render function not defined.
What is expected ?
to go to the google login page
What is actually happening?
Nothing happens
Additional comments?
I am using typescript for this project I added ‘@types/nuxtjs__auth’ to my package.json
<div align="right">This bug report is available on Nuxt community (#c607)</div>About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 16
- Comments: 17 (1 by maintainers)
@yuruyuri16 I found an interim fix that works until this is patched!
I fixed this issue by adding nanoid 2.1.11 as a direct dependency in my project by running…
npm i nanoid@2.1.11I’m having the same issue. But installing nanoid@2.1.11 didn’t work for me. I’m using oauth2 here’s my config:
error:
this issue still exists can confirm
doing
npm install nanoid@2.1.11worked for me as well@Will-Burgon you should never touch any of the files in the
.nuxtdirectory. They are the result of the webpack compilation.Doing an
npm install nanoid@2.1.11worked for me.I have encountered this as well, and I have found what I believe the issue is.
If you go to
./.nuxt/auth/schemes/oauth2.jsand update this line…import nanoid from 'nanoid'to this…import { nanoid } from 'nanoid', it works.But the second Nuxt’s hot reload kicks in, it will revert it back to the broken state.
doing npm install nanoid@2.1.11 worked for me as well.
When can this be fixed? This is a pretty crazy workaround.
Fixed in https://github.com/nuxt-community/auth-module/pull/906
Thanks @heyshadowsmith, will try this later, been bugging me for the last few hours that I have to change the import of nanoid in the
./.nuxt/auth/schemes/oauth2.jsfile everytime the app rebuilds.