Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with importing type declarations from TS modules #3

Open
sraby opened this issue Nov 21, 2022 · 0 comments
Open

Fix issue with importing type declarations from TS modules #3

sraby opened this issue Nov 21, 2022 · 0 comments

Comments

@sraby
Copy link
Member

sraby commented Nov 21, 2022

When working on #2, I kept hitting this error. Ended up saving the custom type declarations in the src directory instead.

TS7016: Could not find a declaration file for module 'react-anchor-link-smooth-scroll'. '/home/runner/work/subway-quiz/subway-quiz/node_modules/react-anchor-link-smooth-scroll/lib/anchor-link.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-anchor-link-smooth-scroll` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-anchor-link-smooth-scroll';`
     5 | import { Results } from "./components/Results";
     6 | import { getQuizContent } from "./data/quiz-content";
  >  7 | import AnchorLink from "react-anchor-link-smooth-scroll";

Maybe has to do with the duplication of the /subway-quiz directory in the pathname?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant