Skip to content

Setting relative homepage not working for media assets #9377

Closed
@kubasulek2

Description

@kubasulek2

Describe the bug

After setting "homepage": "./react/build" in package.json, all paths are set correctly (css, js) but media still points to '/static/media'.

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Adding Images, Fonts, and Files,
Deployment

Environment

Ubuntu 19.04, node 12.13.0, npm 6.14, create-react-app 3.4.1

Steps to reproduce

  1. install create-react-app
  2. add mp3 files to project
  3. load files to project using relative URLs
  4. set relative homepage in package json
  5. deploy a build

Expected behavior

Media files are linked relative to homepage URL

Actual behavior

Media files are linked relative to root folder

image
image

Workaround

Adjust all media paths in main.chunk.js file

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions