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.

[Bug] TypeScript template does not support image import

See original GitHub issue

I’d like to import an image, but there’s error:

TS2307: Cannot find module './logo.png' or its corresponding type declarations.
     6 | import './app.css'
     7 |
  >  8 | import logo from './logo.png'
       |                  ^^^^^^^^^^^^

How to fix please?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ngocdaothanhcommented, Apr 7, 2021
0reactions
SleeplessBytecommented, Apr 7, 2021

Yes, we’ll definitely take a PR 🥳 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing images in TypeScript React - "Cannot find module"
This file classes all types of image files and many more as modules that can be imported. inside the file there should be...
Read more >
Failure importing images · Issue #172 · wmonk/create-react ...
I had to find this issue to figure out why I couldn't import a PNG file, even though README.md said that it should...
Read more >
How to use Vue 3 with TypeScript - LogRocket Blog
Build an example Vue app in TypeScript with class-based components, Vuex for state management, lifecycle hooks, and more.
Read more >
Add images to a React project with Typescript
Adding an image with React is very simple and fast, this is an example: import React from "react"; import imageToAdd from "./../assets/images/ ...
Read more >
gatsby-plugin-image
The Gatsby Image plugin includes two image components: one for static and one for dynamic images. An effective way to decide which you...
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