fix(ssr): imported image paths set wrong #10982
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes https://mozilla-hub.atlassian.net/browse/MP-1088
Problem
On https://developer.mozilla.org/en-US/plus this error appears in the browser console:
This is because our ssr webpack config is improperly configured.
Solution
Copied the relevant lines from the client webpack config, in-lining the value for
dataUrlCondition.maxSize
(0) and adding the appropriategenerator
options to ensure the ssr doesn't output these assets and sets the appropriate asset url in the generated html.The previous rule also set an svg rule, so moved that rule above into the svg config to maintain that behaviour (which in itself seems far from ideal, but seems to work - removing the rule breaks things).
This is still far from ideal but kept the change minimal to fix this specific issue, and I've tabled a discussion for the next engineering sync to discuss further fixes to the webpack config vs just switching to a different bundler.
Screenshots
No change
How did you test this change?
yarn dev