question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage with images from public folder

See original GitHub issue

Is it possible to use this plugin for images from /public folder?

Is this connected to RafidMuhymin/astro-image-demo/issues/1 ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
thagxtcommented, Feb 11, 2022

Yes, I agree 100%. btw Astro said they’re going to implement something similar to this (out-of-the-box) in the future…

0reactions
IanVScommented, May 6, 2022

It looks like it’s necessary to add the /public path explicitly to the src. I think this is unfortunate, maybe this package could try looking inside /public automatically if it can’t find the file at the provided src? I’m trying to convert an <img> to <Picture/>, and it’s unfortunate that the normal src can’t be used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJS and images in public folder - Stack Overflow
A simple solution is to use paths like this /images/logoFooter.png . If the file is ...
Read more >
Using the Public Folder - Create React App
To reference assets in the public folder, you need to use an environment ... as described in “Adding Images and Fonts” above this...
Read more >
How to use files in public folder in ReactJS ? - GeeksforGeeks
How to use files in public folder in ReactJS ? · Step 1: Create a React application using the following command: npx create-react-app...
Read more >
How to import or use images in ReactJS - Tutorialswebsite
To reference asset in the public folder, you need to use a special variable called “PUBLIC_URL”. You can only access the image with ......
Read more >
how to add image in react from public folder - You.com
To add images in public folder with React, we get the path to the public folder with process.env.PUBLIC_URL and concatenate the relative image...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found