# Okta Vue Guide Code Not working

**URL:** <https://devforum.okta.com/t/okta-vue-guide-code-not-working/12178>\
**Category:** Questions\
**Created:** [December 17, 2020, 6:52am UTC](https://devforum.okta.com/t/okta-vue-guide-code-not-working/12178 "2020-12-17T06:52:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shjeong](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@shjeong](https://devforum.okta.com/u/shjeong)\
**Post date:** [December 17, 2020, 6:52am UTC](https://devforum.okta.com/t/okta-vue-guide-code-not-working/12178/1 "2020-12-17T06:52:46Z")

</div>

I am following the okta vue guide document.  
I am getting the error ‘Uncaught TypeError: Cannot call a class as a function’.

The code is index.js on the router side and is as follows

import Auth, {LoginCallback} from’@okta/okta-vue’  
const oktaConfig = {  
clientId: process.env.VUE\_APP\_OKTA\_CLIENT\_ID,  
issuer: process.env.VUE\_APP\_OKTA\_ISSUER,  
redirectUri: process.env.VUE\_APP\_OKTA\_REDIRECT\_URL,  
scopes: [‘openid’,‘profile’,‘email’],  
responseType: [“id\_token”, “token”],  
pkce: false  
};  
Vue.use(Auth, oktaConfig)

The part where the error occurs is at the bottom of “Vue.use(Auth, oktaConfig)”.

Can you determine the cause of the problem?

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [December 17, 2020, 6:44pm UTC](https://devforum.okta.com/t/okta-vue-guide-code-not-working/12178/2 "2020-12-17T18:44:54Z")

</div>

@shjeong Hi, it looks like oktaConfig is not parsed with correct type.  
Please try the below example:

import Vue from ‘vue’  
import { OktaAuth } from ‘@okta/okta-auth-js’  
const oktaAuth = new OktaAuth({  
issuer: ‘https://{yourOktaDomain}.com/oauth2/default’,  
clientId: ‘{clientId}’,  
redirectUri: window.location.origin + ‘/login/callback’,  
scopes: [‘openid’, ‘profile’, ‘email’]  
})

More details can be found in this [link](https://github.com/okta/okta-vue#configuration)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [April 25, 2022, 4:37pm UTC](https://devforum.okta.com/t/okta-vue-guide-code-not-working/12178/3 "2022-04-25T16:37:59Z")

</div>

Closed on April 25, 2022, 4:37pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
