3 ms·
This hasn't been my experience. How does SSR not work out of the box with NextJS?
by a13n 7y ago
This hasn't been my experience. How does SSR not work out of the box with NextJS?
- dvt 7y agoSimple example: I worked on an app where I wanted to use the @elastic/eui UI framework[1]. That framework (a fairly popular/vetted one) used some DOM manipulations somewhere deep for some thing or other and Next broke with some bizarre error. Had to find this snippet in someone's reported (Gatsby) issue and stick it in my next.config.js file: /** * We have to force the bundling of @elastic/eui and react-ace * as Gatsby, then all loaders below will match and avoid HTMLElement issues */ config.externals = config.externals.map(fn => { return (context, request, callback) => { if (request.indexOf('@elastic/eui') > -1 || request.indexOf('react-ace') > -1) { return callback(); } return fn(context, request, callback); }; }); config.module.rules.push( { test: /react-ace/, use: 'null-loader', }, ); And this was just my first SSR issue. Definitely not "out of the box." [1] https://github.com/elastic/eui https://github.com/elastic/eui