Auth-module: [Auth-next] Unexptected token { when extending a Scheme

Created on 8 Sep 2020  路  3Comments  路  Source: nuxt-community/auth-module

Version

5.0.0-1595976864.509d9d6

Reproduction link

https://github.com/Amoki/nuxt-auth-scheme-bug

Steps to reproduce

The reproduction repo is a brand new nuxt project with auth-next and an empty extend file in auth/oidc_scheme.js

npm run dev

Go to the localhost to trigger the error message

The custom Scheme is just

import Oauth2Scheme from '@nuxtjs/auth-next/dist/schemes/oauth2'

export default class OidcScheme extends Oauth2Scheme {}

and it's enough to trigger the bug.

What is expected ?

Be able to extend a Scheme

What is actually happening?

An error message appears when loading any page of the app.
Capture d鈥櫭ヽran de 2020-09-07 12-34-21.png

Additional comments?

We discussed it on Discord yesterday but I think a trackable issue may be better.

This bug report is available on Nuxt community (#c664)

Most helpful comment

bump

All 3 comments

I'm am bumping up against this too but the error I get is "Cannot use import statement outside a module "

bump

@Amoki @guided1 @kilakewe Hey guys! Just released docs about creation of custom scheme.

Note that this docs is for the latest release of auth-next. If you don't want to update because of possible breaking changes, then see the code below:

For versions before 5.0.0-1608136537.029f778:

import Oauth2Scheme from '~auth/schemes/oauth2' 
Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuwacker picture yuwacker  路  3Comments

manniL picture manniL  路  4Comments

amjadkhan896 picture amjadkhan896  路  3Comments

javialon26 picture javialon26  路  3Comments

dasisyouyu picture dasisyouyu  路  3Comments