Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Gatsby project - WebpackError: ReferenceError: window is not defined #18

Closed
ramit-mitra opened this issue May 18, 2022 · 3 comments

Comments

@ramit-mitra
Copy link
Contributor

Hello,
I am using react-plock for a Gatsby project and it's causing the build to fail.

Definition in package.json,
"react-plock": "^1.1.0",

Error message,
WebpackError: ReferenceError: window is not defined

  • index.js:1
    [ramitmitra.com]/[react-plock]/dist/index.js:1:409

  • index.js:1
    [ramitmitra.com]/[react-plock]/dist/index.js:1:789

  • react.js:35
    [ramitmitra.com]/[fast-deep-equal]/react.js:35:32

  • useCallbackRef.js:28
    [ramitmitra.com]/[@restart]/hooks/esm/useCallbackRef.js:28:18

  • useEventCallback.js:6
    [ramitmitra.com]/[@restart]/hooks/esm/useEventCallback.js:6:1

  • static-entry.js:295
    webpack:/ramitmitra.com/.cache/static-entry.js:295:22

  • useMounted.js:2
    [ramitmitra.com]/[@restart]/hooks/esm/useMounted.js:2:1

Please look into the issue and release a fix. Thank you for the great package and all the hard work.

@ramit-mitra
Copy link
Contributor Author

The issue occurs in versions 1.1.0 and 1.2.0. Installing version 1.0.0 with gatsby 4.14 does not cause this exception during the build.

@ramit-mitra
Copy link
Contributor Author

Raised a PR to hopefully get it sorted, please review #19

@askides
Copy link
Owner

askides commented May 18, 2022

Hi, released.

@askides askides closed this as completed May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants