Assets with dynamic names are not resolved
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.14.2
- Nuxt Version:
3.0.0-rc.8
- Package Manager:
npm@7.17.0
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-pq8nym?file=app.vue
Describe the bug
If you have an image referencing a dynamic asset, e.g.
<template>
<img :src="`~/assets/${dynamic_image_name}`" alt="Discover Nuxt 3" />
</template>
<script setup lang="ts">
const dynamic_image_name = 'zero-config.svg';
</script>
then this is rendered as
<img src="~/assets/zero-config.svg" alt="Discover Nuxt 3">
without correctly resolving (and copying) the image, thus it doesn’t show in the browser.
Additional context
Refs https://github.com/nuxt/framework/pull/6635.
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:11
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Vue.js dynamic images not working - Stack Overflow
js with webpack web app, I need to display dynamic images. I want to show img where file name of images are stored...
Read more >Dynamic Group not removing assets who fail to meet criteria
Solved : I have the latest version of Lansweeper. I created a dynamic group with three filter criteria: State Equal To Active Software...
Read more >Dynamic Asset Definition Rules in SC 5.1
Good Morning, I'm trying to create some Dynamic Assets within Security Center 5.1. I've been trying to add the following rules within the ......
Read more >Troubleshooting Dynamic Media - Scene7 mode
Check asset jcr:content > dam:assetState = if unprocessed it was not picked up by the workflow. Wait until asset is picked up by...
Read more >Dynamic tag based on list of specific host/asset names?
If one is not found, then perhaps try to tag based on an IP address next. Currently I am assigning static tags manually...
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 FreeTop 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
Top GitHub Comments
Is this the only way to get dynamic images in Nuxt 3? Was super easy in Nuxt 2 with require.
Wait for the official to provide a better solution.😅😅