---
title: "Discussion on \"axios 응답 인터셉터로 리턴 값 변경 시 타입에러 발생\" | Hashnode"
description: "Discussion on \"axios 응답 인터셉터로 리턴 값 변경 시 타입에러 발생\". 🐞 문제상황\naxios에서 interceptor를 사용해서 데이터를 바로 리턴해주도록 설정했다. 그런데 axios에서 리턴 받은 데이터 객체의 속성을 바로 사용하려고 하니 타입에러가 발생했다. 그리고 인터셉터를 적용하지 않은 것처럼 data.data.속성명을 작성했더니 타입에러가 뜨지 않았다.\n// utils/api.ts\nconst api = axios.create({\n  baseURL: 'http://baseurl',\n  timeout: 1..."
url: "https://hashnode.com/posts/axios/678dc7660fbbece33208ed06"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [axios 응답 인터셉터로 리턴 값 변경 시 타입에러 발생](https://hwayoung.hashnode.dev/axios?utm_source=hashnode&utm_medium=feed)

🐞 문제상황 axios에서 interceptor를 사용해서 데이터를 바로 리턴해주도록 설정했다. 그런데 axios에서 리턴 받은 데이터 객체의 속성을 바로 사용하려고 하니 타입에러가 발생했다. 그리고 인터셉터를 적용하지 않은 것처럼 data.data.속성명을 작성했더니 타입에러가 뜨지 않았다. // utils/api.ts const api = axios.create({ baseURL: 'http://baseurl', timeout: 1...

Jan 20, 2025 · 3 min read · hwayoung.hashnode.dev  
Updated Feb 10, 2025  
Read the article

-   [#axios-interceptor](https://hashnode.com/tag/axios-interceptor)

## Written by

[화영](https://hashnode.com/@hwayoung)

@hwayoung

  
[View profile](https://hashnode.com/@hwayoung)

프론트엔드

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
