-
Notifications
You must be signed in to change notification settings - Fork 246
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
fix: Nuxt3 module & plugin #562
base: main
Are you sure you want to change the base?
Conversation
hadn't realize that the context was in ssrContext.
Would love to see this merged 👀 |
@pi0 can you please take a look at this? EDIT: @aldarund @anteriovieira @atinux @codebender828 @danielroe @DavidBernal @dotneet @farnabaz @gaetansenn @hmsk @JulienTant @kevinmarrec @lihbr @limichange @lupas @manniL @mvrlin @NicoPennec @paulgv @pimlie @potato4d @qm3ster @ricardogobbosouza @sam3d @Tabrizian @vuchl @warriorBrian can someone please take a look? |
Thank you for the PR @teranode Actually this is more complex that it seems since in Nuxt 3 we do have direct function call when making local request to the server. See more on https://v3.nuxtjs.org/docs/migration/component-options#isomorphic-fetch What are the features that you need from axios that you cannot do with |
@atinux Wasn't about features that I needed, the auth module used this module to function, and the auth module itself is taking long to release so ended up having to convert that too. |
@teranode A new auth module for Nuxt 3 is planned in Q2 2022 |
@Intevel I am aware of that. |
@teranode Thanks for your initiative and efforts for Nuxt 3 compatibility of this module. I'm the author of axios, proxy, and auth modules (as well as Nuxt3!). All 3 modules were deeply designed to work well with the Nuxt 2 server architecture and even if we make our best to make them "just working" with Nuxt 3, they are not close to Nuxt 3 compatibility. Base URL handling, ESM and fetch support (for non-node.js servers) are essentially missing features from the axios module. Regardless, I agree, that we should have basic compatibility for popular modules like axios and proxy, making migration easier. |
In general I think it would be too much work to update the |
@pi0 It was a fun experience for me. On a side not, I do wonder how the proxy module will work considering that when using the function-based approach it wont work and had to resort to generating files inside the server folder (using the vite settings also had the same issue.). @Intevel It works for the most part, there are a few bugs here and there (if people tell me what they are), the one glaring issue that I'm facing currently is that axios, pinia, and auth (or really any plugin that also has server sided capabilities) aren't available on the client side when using global middleware |
Also (besides nuxt3's built in functions) wouldn't |
@atinux it would nice for |
Should I close this, seeing as you are going to be using Nuxt's isomorphic fetch api? |
Hi @teranode. Please keep it open i would love to continue on your work for at least basic compatibility with Nuxt3. Sorry it took long. There was tons of other stuff to work on. BTW yes, please consider using Nuxt 3 native fetch/$fetch whenever possible! |
If we want to switch from axios to Nuxt 3 fetch, what do we need to change in our code? Where's the docs on that? |
Applying what I did here: #536 (comment)
to the actual module.