Can't use an image without src/assets/ at the path

I have a problem why can't I use images from the assets folder if there is no src/assets/image.png at the beginning of the path?
20 Replies
Raqueebuddin Aziz
Can you show some relevant code that isn't working Also are you using solid start?
Дикий
Дикий6mo ago
<img src='/smiles/1.png' alt='12'} />
<img src='/smiles/1.png' alt='12'} />
nope
Raqueebuddin Aziz
What are you using then? Just the base vite setup?
Дикий
Дикий6mo ago
yes
<Alterion.Dev>
<Alterion.Dev>6mo ago
assets is for internal things you import in code. public is for resources that are accessible directly in the front-end server if you put your images inside of the public folder instead, it will be accessible from the src tag in an image, as a "regular" path.
Дикий
Дикий6mo ago
So I can just rename the assets folder to public?
<Alterion.Dev>
<Alterion.Dev>6mo ago
a vite project, by default, will already contain a public folder it's not inside the src folder
Дикий
Дикий6mo ago
I don't have it
Raqueebuddin Aziz
Create it
<Alterion.Dev>
<Alterion.Dev>6mo ago
did you... delete it?
<Alterion.Dev>
<Alterion.Dev>6mo ago
it's there by default, I assure you
No description
Raqueebuddin Aziz
It isn't in some of old solid templates
<Alterion.Dev>
<Alterion.Dev>6mo ago
I've never made a vite project that didn't have this after using npm create vite ah yes maybe by using degit which I believe isn't recommended anymore
Дикий
Дикий6mo ago
I used degit
<Alterion.Dev>
<Alterion.Dev>6mo ago
honestly you should probably just run npm create vite@latest , to get a better project structure to start with, and move your component code over
Дикий
Дикий6mo ago
the project is too heavy and it would be better to stay on this structure
<Alterion.Dev>
<Alterion.Dev>6mo ago
try to just create the public folder and see if it works
Дикий
Дикий6mo ago
Yay, it's working!
<Alterion.Dev>
<Alterion.Dev>6mo ago
:iara_cheer_yay:
Want results from more Discord servers?
Add your server
More Posts
solid-router | return Navigate as componentIs there any way to return `<Navigate href="/auth/login" />` as a component rather than an element? Anchor with target="_blank" leading to app's URLI have a link with the `href` set to an external link for an image. When clicking on this link, a neSolid-start site shows blank page when deployed with github-pagesThis is the deploy.yml I used https://nitro.unjs.io/deploy/providers/github-pages repo https://githIs there a way to get Server Reference inside SolidStart? or other way to use webSocketsI just want to know if there is way to get to server reference that would be usable inside Socket.ioPassing data from `event.locals` to FrontendHey folks, I'm super new to solid/solid start, but I'm trying to implement some authentication and IHow does the "You might not need an effect" page from react.dev translate to SolidJS's effects?I feel like they are both the same construct, but since Solid has a fundamentally different way of rDoes solid-element support defining methods on web components?I'm not currently using `solid-element` to define my web component, because I need to define methodsI'd like to see an example of working with a microservices API architectureI think this is the example that is missing from SolidstartSolidStart or Vite + solid-pwa plugin for creating a fast and secure PWA app?I want to create a PWA app using Solid. I am not decided on if I want to use CSR or SSR but I'm leanis Index of Store that is array Signal?I created an array containing several objects based on createStore. When I iterate through this arra