Next.js 12 fails to render page that uses Uppy

Started by domhede4 replies1,701 views
domhedeOriginal post
#1

Hello,
I’m struggling to get Uppy to work after recently upgrading to Next.js 12 and React 18.
When running next start. Any page that calls useUppy results in a blank page and a console error.
Uncaught SyntaxError: Unexpected identifier pointing to this line

image

I have added a unique id to the Uppy plugin, as the error message suggests.

This does not occur when I run next dev.

Any help or ideas would be most appreciated.
Thanks

MerlijnTransloadit team
#2

Are you server-side rendering Uppy? I don’t think that’s possible. Seems you are re-adding a plugin somehow, resulting in this crash. Are you initializing Uppy correctly?

zzleki
#4

I didn’t get this error eith Next12 and minify enabled… Are you using the useUppy() hook to instanciate the Uppy instance?

zzleki
#5

I’ve struggled to get it to work too, and I wrote my problems and solution here