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

New polyfill to fix PubSub for SSR breaks checks for SSR. #640

Closed
cgarvis opened this issue Apr 12, 2018 · 4 comments
Closed

New polyfill to fix PubSub for SSR breaks checks for SSR. #640

cgarvis opened this issue Apr 12, 2018 · 4 comments
Labels
bug Something isn't working PubSub Related to PubSub category

Comments

@cgarvis
Copy link

cgarvis commented Apr 12, 2018

Versions:
aws-amplify@0.2.15
next.js@5.0.1

What is the current behavior?
When using the latest amplify code with polyfill, it doesn't polyfill the window object fully so it breaks other SSR checks liked here: https://github.com/zeit/next.js/blob/085b2f806afd4d16e6f4754cce62e88d7bd47518/lib/router/router.js#L45-L50 which in getUrl is looking to the href on location which hasn't been polyfilled.

What is the expected behavior?
Set location to empty object.

@nidsharm nidsharm added bug Something isn't working PubSub Related to PubSub category labels Apr 12, 2018
@nidsharm
Copy link

Hi @cgarvis,

Thank you for reporting this bug. We will fix it soon.

@leonfs
Copy link

leonfs commented Apr 18, 2018

Encountered the same problem. @cgarvis Have you rolled back to a previous version? or you are still unable to use aws-amplify with nextjs SSR?

@michaelmerrill
Copy link
Contributor

michaelmerrill commented Apr 26, 2018

Also experiencing this issue with the latest versions of amplify and nextjs.

"aws-amplify": "0.3.3",
"aws-amplify-react": "0.1.43",
"next": "5.1.0",

Quick question. If amplify adds a location property with an empty object to the polyfill here, nextjs will still error due to href not being defined. What's the solution there? Is it something that amplify should handle or nextjs in the way they are getting the url here.

mlabieniec added a commit that referenced this issue May 17, 2018
Add location and href props to polyfill - issue #640
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working PubSub Related to PubSub category
Projects
None yet
Development

No branches or pull requests

4 participants