Deluze / electron-vue-template

Simple Vue3 + Electron starter template in TypeScript, including ViteJS and Electron Builder
MIT License
534 stars 104 forks source link

Use axios when app is build #28

Closed HozSensei closed 1 year ago

HozSensei commented 1 year ago

Hey ! First thanks for your work, i use your template and it's very usefull ! I have an issue when i use electron + axios. I make some axios request, everything works when i am in dev mod. But when i build i have 401 error. Is there a fix/trick to make axios works when i build? I don't know if i explain well my problem ^^'

Thanks !

Deluze commented 1 year ago

Glad to hear this project has been helping you. What API are you consuming? From having to guess what you wrote here it could be that some credentials aren't being send/set in your production app.

I don't have enough information to help you with this exact issue, surely axios is being bundled into your app since the request is being made. I suggest adding some logs to your app before making the request to double check if you're sending the correct credentials.

HozSensei commented 1 year ago

Wow ! I feel so dumb.. That was the problem. I create a config file. But the path to it was wrong... So now it works. Thanks for your answer and for the projet !