error ToastContainer after running `tsc` in command line
See original GitHub issueDo you want to request a feature or report a bug? Report a bug
What is the current behavior?
After upgrading react-toastify
to v7.0.2, I execute tsc
in command line. Unfortunately I got error message like this:
node_modules/react-toastify/dist/components/index.d.ts:3:15 - error TS2307: Cannot find module './ToastContainer' or its corresponding type declarations.
3 export * from './ToastContainer';
~~~~~~~~~~~~~~~~~~
node_modules/react-toastify/dist/index.d.ts:3:10 - error TS2305: Module '"./components"' has no exported member 'ToastContainer'.
3 export { ToastContainer, Bounce, Flip, Slide, Zoom } from './components';
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn’t have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
- Create web app template with react and typescript
- Import
ToastContainer
component, then use it into your app. - Check typescript checking with command
tsc
What is the expected behavior?
No error emit after execute tsc
.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? I am using react v17 and ubuntu OS.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Toastify React, error when attempting to use - Stack Overflow
Using the following: import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css';. I get the ...
Read more >typescript error Cannot find module .js Code Example - Grepper
Answers related to “typescript error Cannot find module .js” ... typescript import cannot find module after npm install · typescript cannot find module ......
Read more >Build a FullStack tRPC CRUD App with TypeScript 2022
Install the client, server, and workspace dependencies by running yarn install or yarn in the terminal of the root project.
Read more >Customise Ngx-toastr in angular 6 with typescript - iTecNote
Hii All i am implementing Ngx-toastr in angular 6 with typescript my problem is that i can't make it beautiful as i want...
Read more >Build a real-time app with MEAN2, angular-cli and socket.io
Angular CLI: Command line tool that helps to create an Angular2 project ... to the index file present in dist folder when running...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, @felixmosh that was helpful. TBH I don’t even know how this happened. I’ve built it again and published a new version to npm.
same in my projects, the
ToastContainer.d.ts
is missing innode_modules
, (using yarn 1)