Remove ssr.noExternal
from SPA template
#8952
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.
The SPA template is currently broken due to this setting. In dev mode, I get the following error:
During the build I also see this:
Rather than simply removing
ssr.noExternal
, I tried to fix it by also settingssr.external
to avoid bundling troublesome dependencies. I was able to fix it with the following config:I thought this might be good enough, but I decided to try introducing
react-bootstrap
since this was package that originally triggered this change due to Rollup build errors. I then received the following error:I can fix this in dev by adding
react-bootstrap
to thessr.external
array, but then we're back where we started with a broken build. Instead, I had to add the lower-level offending packages to get both dev and build to work:So taking a step back, this felt like we had replaced one problem with a worse one, since the original issue with
react-bootstrap
can be fixed more succinctly and directly like this:So I think ultimately it's a safer bet for us to leave this area unconfigured for now unless we can find a better way to avoid these sorts of issues.
Either way, this PR can be thought of as a hotfix to get the template back to a working state.