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

vite5+vue3+ts Sending request error SyntaxError: The requested module '/node_modules/.vite/deps/axios.js?v=bc297318' does not provide an export named 'AxiosInstance' #6343

Open
1079161148 opened this issue Apr 6, 2024 · 1 comment

Comments

@1079161148
Copy link

Describe the bug

SyntaxError: The requested module '/node_modules/.vite/deps/axios.js?v=bc297318' does not provide an export named 'AxiosInstance'
[Vue Router warn]: Unexpected error when starting the router: SyntaxError: The requested module '/node_modules/.vite/deps/axios.js?v=bc297318' does not provide an export named 'AxiosInstance' (at request.ts:9:81)

<script setup lang="ts"> import { ref } from 'vue' import { getImageUrl } from '@/utils/index' import { userLogin, loginParams } from '@/api/login' const tel = ref('') const sms = ref('') const password = ref('') const showPassword = ref(false) const handleLogin = async () => { try { const params: loginParams = { phone: tel.value, password: password.value } let res = await userLogin(params) console.log(res, 'res') } catch (error) { console.log(error, 'handleLogin') } } ### To Reproduce _No response_ ### Code snippet _No response_ ### Expected behavior _No response_ ### Axios Version "axios": "^1.6.8", ### Adapter Version _No response_ ### Browser Version 123.0.6312.105 (official version) (64 bit) ### Browser Version _No response_ ### Node.js Version v18.12.0 ### OS _No response_ ### Additional Library Versions ```bash "@vueuse/core": "^10.9.0", "amfe-flexible": "^2.2.1", "axios": "^1.6.8", "crypto-js": "^4.2.0", "dayjs": "^1.11.10", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "vant": "^4.8.8", "vue": "^3.4.21", "vue-router": "^4.3.0" ``` ### Additional context/Screenshots _No response_
@justindhillon
Copy link

This doesn't tell us a lot about your issue. If you provide a snippet of your code, we will have a much better chance of helping you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants