Auth0 Home Blog Docs

Unexpected Token Error


I have this code from the website, informing me how to setup the WebAuth function of Auth0. I put it in my application and am receiving an unexpected token error on the equals sign that is to the right of the variable weba.

import auth0 from 'auth0-js';

export default class Auth {
  weba = new auth0.WebAuth({
domain: '',
clientID: 'T6SjpXYPWBvbFwLts3YbXKVQd4gCxUvp',
redirectUri: 'http://localhost:3000/callback',
audience: '',
responseType: 'token id_token',
scope: 'openid'

  login() {

I have been debugging for the past hour and haven’t had any understanding of why this error is being thrown. Any thoughts?


:wave: @chasen-bettinger have you previously declared the weba variable? Which website are you referring to? Are you able to share the error message you are receiving?


You’re probably trying to use class fields, which is still in stage 3 proposal, in a browser that doesn’t support it. You need to compile this code a compatible javascript version.


1 Like

This link here:

Sorry for being ambiguous.

The error message is quite literally:

utils/AuthService.js: Unexpected token (17:7)

 lock = new Auth0Lock(config.AUTH_CONFIG.clientId, config.AUTH_CONFIG.domain, {

I have since changed it from WebAuth to Auth0Lock. Everything else constant.


Can you follow one of our quickstarts?

It’s easier if you start with a technology you already know.