DEV Community


Can't figure out Single SPA + SystemJS + Code Splitting

Pedro Otero Prada
JavaScript developer
・1 min read

Can't seem to figure out how to set up either Webpack or SystemJS to load applications in Single SPA that are split.

It works just fine when I'm not splitting the code of the microapps (ejected CRA). But once I do, I get this error I can't make sense of:


What should I be googling?

Discussion (2)

frehner profile image
Anthony Frehner

here's a helper library that should solve this problem.

TLDR: When you codesplit in webpack, you need to set the public path so that webpack knows where to look for that codesplit - by default it makes assumptions that work in most cases, but not in single-spa situations.

Feel free to check out the docs and also join us in the Slack channel linked in the bottom of that page as well.

bensawyer_ profile image
Ben Sawyer

"single-spa missing bootsrap function" 🤷

I love the idea of framing a question like this from the perspective of what should I be searching based on my problems context, very cool. Might be a good idea for a stack overflow alternative...

I wonder if there is a service similar to codepen that would allow for sandboxing and sharing frontend builds like this to collaborate on, test and debug? i.e. something a little more accessible than just git cloning. Now that I think about it there was vagrant...