2d-inc / Flare-React

Example React Component to display Flare animations.
MIT License
103 stars 11 forks source link

window is not defined #6

Open grantralls opened 5 years ago

grantralls commented 5 years ago

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

AntwanSherif commented 4 years ago

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

neio-dev commented 4 years ago

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

Kassan424kh commented 4 years ago

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

Kassan424kh commented 4 years ago

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});