-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
No loader is configured for ".svg" files #6316
Comments
@Jackardios was this working for you on stable versions of Remix? (i.e. 1.15 or 1.16?) Could you share where your SVG file is located ( |
@pcattori it works in 1.16.0, the problem only occurs in 0.0.0-nightly-6e23fcf-20230505 Svg file is located within import * as React from "react";
import logoImage from "@/modules/common/assets/images/logo.svg";
import { Image } from "@/modules/design-system/components/Image";
export interface LogoProps
extends Omit<React.ComponentPropsWithoutRef<"img">, "src"> {}
export const Logo: React.FC<LogoProps> = ({
width = 158,
height = 34,
...otherProps
}) => {
return (
<Image
src={logoImage}
width={width}
height={height}
{...otherProps}
/>
);
}; |
Does the error happen when running |
I'm also experiencing this on 0.0.0-nightly-c7ad951-20230508. Worked fine on stable. Only experiencing this when running with |
Cannot reproduce. The following works for me on:
import type { V2_MetaFunction } from "@remix-run/node";
import svg from "~/SVG_Logo.svg";
export const meta: V2_MetaFunction = () => {
return [{ title: "New Remix App" }];
};
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<h1>Welcome to Remix</h1>
<img src={svg} height={64} width={64} />
</div>
);
} If anyone can post a full reproduction, I can look into it. Note that using svgs as component is not supported out-of-the-box in Remix. |
@pcattori As mentioned on discord, getting the exact same issue but with PNG files. Tried making a repro loading the same PNG file from the same relative path, and of course it's not breaking there, even copying over my exact same package.json and remix.config.js files. I'll need to try some other options for reproducing it. It does seem to only happen running |
@dmarkow does the issue only happen with |
Ah ok I was able to reproduce! Issue happens when a route with a loader has loader changes and has import svg from "~/SVG_Logo.svg";
// uncommenting this loader while `remix dev` (unstable_dev: true) is running causes the issue
//export let loader = () => {
// return { hello: "there" };
//};
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<h1>Welcome to Remix</h1>
<img src={svg} />
</div>
);
} ^So this will fix things when |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
0.0.0-nightly-6e23fcf-20230505
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
No loader is configured for ".svg" files
Expected Behavior
svg should import without error
Actual Behavior
when importing svg there is an error: "No loader is configured for ".svg" files"
The text was updated successfully, but these errors were encountered: