Question

Cannot find module './serviceWorker' or its corresponding type declarations

Hi First of all thanks for the informative post made and it was really helpful for me as a newbie for react and typescript. This could be a silly question that as I gone through the tutorial (https://www.digitalocean.com/community/tutorials/how-to-build-a-customer-list-management-app-with-react-and-typescript) and while trying to run the program it came a issue that “Cannot find module ‘./serviceWorker’ or its corresponding type declarations” in typescript-react-app/src/index.tsx, I struggle a lot to find a solution yet not succeed. Can you help me on this point. Following are the complete error message.

D:/UserData/reactPractice/reactApp4/typescript-react-app/src/index.tsx TypeScript error in D:/UserData/reactPractice/reactApp4/typescript-react-app/src/index.tsx(6,32): Cannot find module ‘./serviceWorker’ or its corresponding type declarations. TS2307

4 | import App from './App';
5 | import { BrowserRouter } from 'react-router-dom'; 

6 | import * as serviceWorker from ‘./serviceWorker’; | ^ 7 | ReactDOM.render( 8 | <BrowserRouter> 9 | <App />

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!