Next.js Discord

Discord Forum

How to share asset in turborepo nextjs project

Unanswered
Round sardinella posted this in #help-forum
Open in Discord
Round sardinellaOP
I used <img src="/logo.png" /> but its not work
Help me ! thanks

15 Replies

Wait what do you want? Files from another package to go to your nextjs?
@Round sardinella I used <img src="/logo.png" /> but its not work Help me ! thanks
I don't think it is even possible to share static assets in a monorepo
let me try to make a minimum repro
You could try with simlinks
It is possible to share static assets
but you can't do /logo.png
you will have to import it from the package itself
Yeah that is the best I could think (outside weird sinlinkng which... I dont trust)
1. The image is present inside the ui folder
2. The image is being used in page.tsx
3. The way of importing
here is the image at localhost:3001
ignore the text TURBOREPO
Also note that the image's url will be a hash instead of clean (thus why need import then before)
btw apologises for the automod, idk how but it seems it hallucinated
Uhh maybe because he posted it in general and it now doesn't like crosspost