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

Vue3 + Vite + Okta Vue, Redirecting path is going wrong in Dev Environment. #392

Closed
8 of 9 tasks
PavankalyanPayyavula opened this issue Apr 12, 2024 · 3 comments
Closed
8 of 9 tasks

Comments

@PavankalyanPayyavula
Copy link

PavankalyanPayyavula commented Apr 12, 2024

Related plugins

Describe the bug

Hi,

I am working on developing an new application using Vue3 + Vite + Okta Vue and Codebuild.
These are the below libraries I am using in my application
@okta/okta-auth-js, @okta/okta-vue,

When I am try running application in my local machine in dev mode it is working. But when I build then I guess rollup is not able to import them properly.

Reproduction

I've tried it on an empty Vue3 project with Vite and vue-router, just adding the Okta components.
Create a project following the Vue v3 using vite

Add okta widget as in the basic Okta guide for Vue v3 (https://developer.okta.com/docs/guides/sign-in-to-spa-authjs/vue/main/)

npm install @okta/okta-auth-js
npm install @okta/okta-vue
Now try to run it

npm run dev
And I get the error:
[vite] Optimizable dependencies detected:
@okta/okta-auth-js, @okta/okta-vue, vue

Steps to reproduce

No response

System Info

I am using Mac OS,
Node version 20.9.0
Vite 5.3.1
Vue 3.4.29

Used Package Manager

npm

Logs

No response

Validations

@PavankalyanPayyavula
Copy link
Author

PavankalyanPayyavula commented Jun 17, 2024

@yyx990803, @patak-dev any help on this. I understood that Vite rollup is not able to import Okta Auth library @okta/okta-auth-js after the build. It is working fine when I try to run application in local.
I have tried adding alias as below.

resolve: {
      alias : {
        '@okta/okta-auth-js' : '@okta/okta-auth-js/dist/okta-auth-js.umd.js'
      }
    },

But it is breaking in my local dev.

@patak-dev
Copy link
Member

This doesn't seems to be related to vite-plugin-vue, and there is no minimal reproduction. If you manage to get a minimal reproduction showing an issue in Vite, please share it there. If not, create a Discussion.

@patak-dev patak-dev closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
@PavankalyanPayyavula
Copy link
Author

Hi @patak-dev,
Please have look that this issue vitejs/vite#1315.
My issue actually related the above issue. I have followed the solution suggested by Evan. But it is not working.

I understood that this is not related to vite-plugin-vue. But I guess this is related to Vite. Since this is related to authentication library. I cannot manage to get a minimal reproduction showing an issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants