Skip to content

Commit

Permalink
fix: error cannot find adapter
Browse files Browse the repository at this point in the history
downgrade axios version to `1.1.3`, waiting for axios/axios#5324 to merge
  • Loading branch information
adenvt committed Apr 18, 2023
1 parent 07bc0b4 commit 57559b4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
1 change: 0 additions & 1 deletion build.config.ts
Expand Up @@ -2,7 +2,6 @@ import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries : ['./src/index'],
externals : ['#imports'],
declaration: true,
rollup : {
emitCJS : true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"@nuxt/kit": "^3.4.1",
"axios": "^1.3.5",
"axios": "1.1.3",
"defu": "^6.1.2",
"requrl": "^3.0.2",
"ufo": "^1.1.1"
Expand Down
11 changes: 11 additions & 0 deletions playground/app.vue
@@ -1,8 +1,19 @@
<template>
<div>
Nuxt module playground!
<pre>{{ users }}</pre>
</div>
</template>

<script setup>
import { onMounted, ref } from 'vue'
import { useApi } from '../src/'
const users = ref([])
onMounted(async () => {
const { data } = await useApi().get('https://reqres.in/api/users')
users.value = data
})
</script>
6 changes: 3 additions & 3 deletions src/queue.ts
Expand Up @@ -2,13 +2,13 @@ import type {
AxiosAdapter,
AxiosPromise,
AxiosResponse,
InternalAxiosRequestConfig,
AxiosRequestConfig,
} from 'axios'
import Axios from 'axios'
import defu from 'defu'

interface QueueJob {
config: InternalAxiosRequestConfig,
config: AxiosRequestConfig,
priority: number,
resolve: (value: AxiosResponse | PromiseLike<AxiosResponse>) => void,
reject: (reason: unknown) => void,
Expand Down Expand Up @@ -55,7 +55,7 @@ export default class QueueAdapter {
}

// eslint-disable-next-line @typescript-eslint/promise-function-async
add (config: InternalAxiosRequestConfig): AxiosPromise {
add (config: AxiosRequestConfig): AxiosPromise {
return new Promise((resolve, reject) => {
const onResolved: QueueJob['resolve'] = (response) => {
resolve(response)
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -975,7 +975,7 @@ __metadata:
"@typescript-eslint/parser": ^5.59.0
"@vitest/coverage-c8": ^0.30.1
"@vue/eslint-config-typescript": ^11.0.2
axios: ^1.3.5
axios: 1.1.3
axios-mock-adapter: ^1.21.4
changelogen: ^0.5.3
defu: ^6.1.2
Expand Down Expand Up @@ -2161,14 +2161,14 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^1.3.5":
version: 1.3.5
resolution: "axios@npm:1.3.5"
"axios@npm:1.1.3":
version: 1.1.3
resolution: "axios@npm:1.1.3"
dependencies:
follow-redirects: ^1.15.0
form-data: ^4.0.0
proxy-from-env: ^1.1.0
checksum: 4d6bcf933b1cdff86d4993752aaeeeedc4a7f7a4b1c942847f6884bb13fc6106610ff826b076acf0b08d8ced55dee9344bb9a11f3624c3e70ab1da1a40bb5506
checksum: cab3b17bf6092c9387f7023d699db093cfa23650b56c4422cd474d124b78b2e3b5a520f932c330664a58ab85b867b1c25a95cace475ef72d236888c852b84e6d
languageName: node
linkType: hard

Expand Down

0 comments on commit 57559b4

Please sign in to comment.