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

v2 breaks SSR apps #34

Closed
csorfab opened this issue Oct 3, 2019 · 4 comments
Closed

v2 breaks SSR apps #34

csorfab opened this issue Oct 3, 2019 · 4 comments

Comments

@csorfab
Copy link

csorfab commented Oct 3, 2019

The new 2.0.+ versions reference window when requiring the package. This breaks SSR apps, as window is not defined when running in a node environment. In 1.2.2 the problem was not present. It is very easy to reproduce.

mkdir anim-ssr-bug
cd anim-ssr-bug
npm install animated-scroll-to
node
> const a = require("animated-scroll-to")

result:

ReferenceError: window is not defined
    at Object.<anonymous> (/Users/csorfab/Web/test/node_modules/animated-scroll-to/lib/animated-scroll-to.js:95:22)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
...
@csorfab
Copy link
Author

csorfab commented Oct 3, 2019

Submitted PR #35 that fixes this issue.

@Stanko
Copy link
Owner

Stanko commented Oct 3, 2019

I'm on it, thank you for the PR!

@Stanko
Copy link
Owner

Stanko commented Oct 3, 2019

Fixed in 2.0.3
6423965

@Stanko Stanko closed this as completed Oct 3, 2019
@csorfab
Copy link
Author

csorfab commented Oct 4, 2019

Thanks for the quick action! :)

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