gilbarbara / react-inlinesvg

An SVG loader component for ReactJS

Home Page:https://codesandbox.io/s/github/gilbarbara/react-inlinesvg/tree/main/demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"window is not defined" when upgraded to 4.0.1 in a Next.js app

kb1995 opened this issue · comments

commented

Describe the bug

I have a Next.js app and I just upgraded from 3.0.1 to 4.0.1 but I get "window is not defined" when I try to load the page

To Reproduce

Upgrade to 4.0.1. My component looks like this:

                <SVG
                              className={cn("h-[45px] w-[45px] text-current")}
                              aria-hidden="true"
                              src={item.icon.filename.replace(
                                "https://a.storyblok.com",
                                "https://s3.amazonaws.com/a.storyblok.com"
                              )}
                            >
                              <Image
                                width={45}
                                height={45}
                                className="mx-auto"
                                src={item.icon.filename}
                                alt={item.icon.alt || ""}
                              />
                            </SVG>

I added the new Cache Provider hoping to fix it, but unfortunately, it didn't work

Hey @kb1995

Fixed in 4.0.2