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

Using RawAxiosRequestHeaders cause compiler error #6369

Open
dimkajasons opened this issue Apr 24, 2024 · 0 comments
Open

Using RawAxiosRequestHeaders cause compiler error #6369

dimkajasons opened this issue Apr 24, 2024 · 0 comments

Comments

@dimkajasons
Copy link

Describe the bug

I need to create a proper type for axios headers object
I have followed #5476 this one - so I can't use AxiosRequestHeaders.

I believe I need to use RawAxiosRequestHeaders. But in case i need to use this type as a generic argument, for example, with React.createContext - it cause compiler error

import { RawAxiosRequestHeaders } from 'axios';

export const RequestHeadersContext = createContext<RawAxiosRequestHeaders | undefined>(undefined);
Exported variable 'RequestHeadersContext' has or is using name 'RawAxiosHeaders' from external module "...node_modules/axios/index" but cannot be named.

I guess it's because interface RawAxiosHeaders is declared locally.

To Reproduce

No response

Code snippet

No response

Expected behavior

No response

Axios Version

No response

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

No response

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

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

1 participant