Amplify-js: New polyfill to fix PubSub for SSR breaks checks for SSR.

Created on 12 Apr 2018  路  3Comments  路  Source: aws-amplify/amplify-js

Versions:
[email protected]
next.[email protected]

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.

PubSub bug

Most helpful comment

Hi @cgarvis,

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

All 3 comments

Hi @cgarvis,

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

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?

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.

Was this page helpful?
0 / 5 - 0 ratings