asset imports from dynamic route #13021
-
Hi there, I am new to nextjs and attempting to migrate my cra project to it. Stumbled upon an issue with asset loading when using dynamic routes. Images and fonts, when loaded in a route component, lets say However when using a route such as all these assets are imported at the app level, eg in Could someone please explain what I'm doing wrong in terms of setting up this route? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@Samuel-Celko I imagine you have your assets under the public folder:
if that is the case you don't need to import them, you can do Just use the '/' as the first character. '/' stands for the root folder |
Beta Was this translation helpful? Give feedback.
@Samuel-Celko
I imagine you have your assets under the public folder:
if that is the case you don't need to import them, you can do
img src="/assets/logo.png"
Just use the '/' as the first character. '/' stands for the root folder