-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Vue Image Embedding Fails in .vue Files with @parcel/[email protected] #10124
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
Comments
This may be beyond Vue — I have a React setup and am seeing something similar: import image from "./assets/test-pattern.jpg";
console.log(image)
import * as styles from "./TestPattern.module.css";
const TestPattern: React.FC = () => (
<img className={styles.container} src={image} />
);
export default TestPattern; This logs <img class="ySmK_a_container e4Rufq_-expand" src="[object Object]"> This code has been working fine for years, so it certainly feels like some recent change somewhere. |
Ah, I found #10116 (comment) (where this issue came from!), which suggests changing the import to use |
To avoid any misunderstandings: I'm not talking about imported image files that I then reference in the templates, but rather image URLs that I specify directly in the templates - without any imports. For example, if I have something like this in a
Previously, the image would load correctly, but now it just shows Importing works fine if I prepend |
Any updates on this? |
Uh oh!
There was an error while loading. Please reload this page.
🐛 bug report
When using
@parcel/transformer-vue
in versions later than 2.13.3, images referenced in.vue
files are rendered as[object Object]
in the HTML output. This issue does not occur when images are loaded outside Vue (e.g., directly inindex.html
).Steps to Reproduce
@parcel/transformer-vue
v2.14.0
or higher.<img src="./image.png">
).Workaround
Pin dependencies to v2.13.3.
🎛 Configuration
🤔 Expected Behavior
Image paths are correctly resolved and rendered in the HTML.
😯 Current Behavior
[object Object]
is output instead of the image path.🔦 Context
May be related to changes in asset handling or serialization in newer versions of the Vue transformer.
The text was updated successfully, but these errors were encountered: