Vite svg import reactLogo from "./assets/react.svg"
has no default
#25642
-
Hello guys, I started a new project on vite with deno and react. But something went wrong: import { useState } from "react";
// !!!!!! Module '"file:///workspace/frontend/src/assets/react.svg"' has no default export.deno-ts(1192)
import reactLogo from "./assets/react.svg";
import "./App.css";
function App() {
const [count, setCount] = useState(0);
return (
<>
<img src="/vite-deno.svg" alt="Vite with Deno" />
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" className="logo" alt="Vite logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
...
}
export default App; I tried to make declare module "*.svg" {
const content: string;
export default content;
} but it doesn't work too. How can I fix this manually (without plugins)? |
Beta Was this translation helpful? Give feedback.
Answered by
marvinhagemeister
Sep 21, 2024
Replies: 2 comments
-
I have the same problem any advance on it ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
FYI: We're tracking this issue in #25762 . |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vadim-su
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI: We're tracking this issue in #25762 .