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
Hi, I use to MSW with axios in react project.
I conducted a tutorial to use msw.
But I have problem 404 error in Safari, No problem in Chrome.
Please, I hope you can help me.
import { setupWorker } from 'msw/browser';
import { handlers } from './handlers';
export const worker = setupWorker(...handlers);
index.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = document.getElementById('root') as HTMLElement;
async function enableMocking() {
const { worker } = await import('./mocks/browser');
console.log(worker);
return worker.start();
}
enableMocking().then(() => {
ReactDOM.createRoot(root).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
});
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
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
-
Hi, I use to MSW with axios in react project.
I conducted a tutorial to use msw.
But I have problem 404 error in Safari, No problem in Chrome.
Please, I hope you can help me.
msw 2.0.14
axios 1.6.7
mocks/handlers.ts
mocks/broswer.ts
index.tsx
ToDoList.tsx
Beta Was this translation helpful? Give feedback.
All reactions