codesandbox / codesandbox/codesandbox-client

The path to attaching a picture to a div via css is incorrect. requiring ../ when the files and folders are already in root

Open
#6,528 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🐛 bug report

Preflight Checklist

  • [X ] I have read the Contributing Guidelines for this project.
  • [X ] I agree to follow the Code of Conduct that this project
    adheres to.
  • [X ] I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

There is something wrong with the file path when adding pictures and using css grid. requiring me to add a picture by using .../ is incorrect. My photos folder is located in my root. see link to sandbox with error. .try adding the picture with ../ and it will work but this is incorrect. the pictures break when i export because the path is wrong and should not be ../

How has this issue affected you? What are you trying to accomplish?

Trying to add a picture to a div via css.. should not be complicated but there is something wrong with the way codesandbox handles paths.

To Reproduce
Link to sandbox: link (optional)

https://codesandbox.io/s/async-water-yiw029?file=/css/style.css

Your Environment

CODEsandbox across all browsers latest versions

Software Name/Version
Сodesandbox
Browser
Operating System

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox, especially css/style.css, and reproduce the image path behavior using the photos folder and CSS grid. Compare the path that works in the editor with the exported result. Done means the image loads without the incorrect ../ prefix and remains valid after export.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.