The apps are all separate next.js apps with their own config and server etc
The components are all compiled with webpack, and then published to a private npm registry. The apps all have dependencies on the components package, all linked up by lerna.
The issue I'm having is that even though its my own package (so I know that I havent introduced any dependencies on the window object), I still get a 'window not defined' error.
The error seems to come from the webpack style-loader, which we use to bundle sass styles with the components. Removing scss imports and the style-loader fixes the issue, but it means we cant use sass in the components.
Only naive solution I can think of is altering the webpack in your other non-Next.js packages to look for window at a different time? That was lightweight what I did but wasn't an educated decision at all.