Flare-React icon indicating copy to clipboard operation
Flare-React copied to clipboard

window is not defined

Open grantralls opened this issue 5 years ago • 4 comments

I imported the package as FlareComponent and called it using the example in the ReadMe. The error I get is "window is not defined" (../FlareReact.js:10:4) I am using nextjs and the file is .flr2d as opposed to .flr

grantralls avatar May 13 '19 00:05 grantralls

@grantralls I have the same issue with nextjs. Did you find a solution/ workaround?

AntwanSherif avatar Jan 28 '20 23:01 AntwanSherif

.flr2d is the file format used for project file. You need to go to 'Export' instead of 'Download file' image

neio-dev avatar Jan 29 '20 15:01 neio-dev

I use .flr file but I still get the same issue, any help

Kassan424kh avatar Sep 14 '20 13:09 Kassan424kh

OK i found the solution to get flare work in next-js

import dynamic from "next/dynamic";

const FlareComponent = dynamic(() => import("flare-react"), {ssr: false});

Kassan424kh avatar Sep 14 '20 13:09 Kassan424kh