Next-plugins: Rendering `undefined`

Created on 9 Feb 2018  路  6Comments  路  Source: vercel/next-plugins

Following the example repo the app renders briefly and then show up as undefined. I've put together an example at: https://glitch.com/edit/#!/bustling-hook

It looks like it could be a problem loading the common.js module.

good first issue help wanted

Most helpful comment

What would be the exact workaround for this I can't figure out your solution @timneutkens 馃槥

All 6 comments

This is caused by the commons logic only including react and react-dom in commons.js in development. preact is not react according to webpack, so there's no common bundle and webpack won't output it because of that. The solution is to wrap the minchunk config in the next-preact module and add the right config.

馃憤 closing. Thanks @timneutkens!

I'd still like to fix it 馃槃

What would be the exact workaround for this I can't figure out your solution @timneutkens 馃槥

I managed to make it work by interpreting what @timneutkens said...
I'll open a PR, it's far from perfect tho, I had to override the CommonChunk plugin with a new one, including preact and preact-compat, and the way it's done could probably be improved... 馃

Any news about this? I'm having this issue with Next.js 7.0.2

Was this page helpful?
0 / 5 - 0 ratings