Skip to content

Internal error: ReferenceError: innerWidth is not defined #5

@ernstnaezer

Description

@ernstnaezer

Hi there,

I'm using your component in a NextJS application ('use client'). When loading the page I get the following error

✓ Compiled in 540ms (590 modules)
 ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
 ⨯ node_modules/react-rc-carousel/dist/esm/components/Slider/index.js (173:22) @ innerWidth
 ⨯ Internal error: ReferenceError: innerWidth is not defined
    at Slider (./node_modules/react-rc-carousel/dist/esm/components/Slider/index.js:202:9)

I think what happens is that the variable isn't declared but used in a memo

https://github.com/stanleyogada/react-rc-carousel/blob/9a820671a978ed6cf5e85add92e87fd00cd25b77/src/components/Slider/index.tsx#L225C1-L231C5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions