0

I built a web version of my app using expo web and react-navigation, and I am serving it using Django. I managed to make everything work when I go on mywebsite.com and navigate around.

However, if I load my website directly on mywebsite.com/OTHER/PAGE, this piece of code fails:

await Asset.loadAsync([require("../../assets/images/Logo.png")]),

after some investigation, I found out that instead of loading this asset:

http://mywebsite.com/web-build/static/media/Logo.ceb44efe.png

it tries to load that one (that doesn't exist):

http://mywebsite.com/OTHER/PAGE/web-build/static/media/Logo.ceb44efe.png

How can I tell it to only use http://mywebsite.com/ as a base URI when loading assets?

Ryan Pergent
  • 4,432
  • 3
  • 36
  • 78

1 Answers1

0

I figured it out. My homepage in package.json was set to "homepage": "web-build", and it should have been "homepage": "/web-build"

Ryan Pergent
  • 4,432
  • 3
  • 36
  • 78