You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to move my project from plasmo to wxt.
In the project I am extensively using axios for api calls.
Unfortunately I am getting an error when trying to use axios.defaults setup. Is that something not allowed in wxt?
Add axios (e.g. npm install axios@latest or yarn add axios)
Add the axios code in background.ts: lines that seems to break it are axios.defaults.headers["Content-Type"] = "application/json" (any other interaction with defaults does that as well e.g. axios.defaults.transformResponse[...]) or type Api = ReturnType<typeof createApi>;
Modify package.json postinstall command with --debug
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to move my project from plasmo to wxt.
In the project I am extensively using axios for api calls.
Unfortunately I am getting an error when trying to use axios.defaults setup. Is that something not allowed in wxt?
Error:
Steps to reproduce:
npx wxt@latest init
npm install axios@latest
oryarn add axios
)background.ts
: lines that seems to break it areaxios.defaults.headers["Content-Type"] = "application/json"
(any other interaction with defaults does that as well e.g.axios.defaults.transformResponse[...]
) ortype Api = ReturnType<typeof createApi>;
yarn run postinstall
background.ts
Beta Was this translation helpful? Give feedback.
All reactions