[Bug] TypeScript template does not support image import
See original GitHub issueI’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:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top 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 >
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 Free
Top 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
👍 I’ve created this PR: https://github.com/react-static/react-static/pull/1597
Yes, we’ll definitely take a PR 🥳 😄