question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error ToastContainer after running `tsc` in command line

See original GitHub issue

Do 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:

  1. Create web app template with react and typescript
  2. Import ToastContainer component, then use it into your app.
  3. 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fkhadracommented, Feb 1, 2021

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.

1reaction
felixmoshcommented, Feb 1, 2021

same in my projects, the ToastContainer.d.ts is missing in node_modules, (using yarn 1)

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found