-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix file loader public path #11206
Fix file loader public path #11206
Conversation
Any thoughts on how we could test this? Unfortunately I think we'd need to run tests in a real browser. |
I think this is really a case where I should have been more careful rather than a failure of tests. But, if there were good tests that'd be great! Maybe we could check that there are no 404's on a test page load? |
@tlrobinson do you have an ETA for the next release? |
@flipace this fix should be out today or tomorrow. |
It seems the bug hasn't been resolved |
@shkhaksar You are commenting on a PR that is almost 3 years old. Create a new issue or use the forum for troubleshooting: https://discourse.metabase.com/ |
My fix in #11174 broke file loading. The presented most obviously as broken fonts.
Here's a history of the issues with this setting:
Situation 1
publicPath
: "app/dist/"file-loader files ended up with this public path duplicated. e.g. "app/dist/app/dist/image.svg". This causes 404's when it tries to load these assets.
Situation 2
publicPath
: "/app/dist/"Everything works! ...unless you host Metabase with a path prefix. In that case everything breaks.
Situation 3
publicPath
: "app/dist/"file-loader's
publicPath
: ""The 404's from the first situation disappear, so I assume it works. However, the files are now referenced without "app/dist/" at all! The server returns a 200, but not the file we want.
This PR
publicPath
: "app/dist/"file-loader's
publicPath
: "./"This seems to actually load the files correctly! It was taken from this Stack Overflow answer.