Closed apradipta10 closed 4 years ago
It is related to this issue: https://github.com/gatsbyjs/gatsby/issues/309
In gatsby development, react components are only run in the browser where window.File
is defined. When building, Gatsby renders these components on the server where window.File
is not defined.
One workaround is to use a try-catch block warping the import of this library.
browser-image-compression@v1.0.8 will support SSR. By that time, you won't need to use a workaround.
I am using browser image compression for my website using gatsby. I just import this,
import imageCompression from 'browser-image-compression';
when I start to gatsby develop everything is normal, but when I tried to gatsby build, i just got error this.