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

Contentful throws error on iPhone 6 iOS 12.5.7 when using Next.js Pages router #2131

Open
reekrd opened this issue Jan 20, 2024 · 2 comments

Comments

@reekrd
Copy link

reekrd commented Jan 20, 2024

Contentful throws SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. on iPhone 6 iOS 12.5.7 when used in the Pages router in Next.js

However the error does not occur when using the App router (as it runs in a server component).

Version 9.3.5 of the contentful client works as expected.

Steps to Reproduce

Here is a minimal repo: https://github.com/reekrd/contentful-test

@wadehammes
Copy link

wadehammes commented Jan 23, 2024

Similar to #1901

I fixed this for us by not having any client-side calls to Contentful, and doing everything in getStaticProps and passing down the response via props. If you have deeply nested references, you will want to make sure you use the includes prop on the api call setup and setting it to something high, like 10, so that all your entries get resolved.

@reekrd
Copy link
Author

reekrd commented Jan 23, 2024

@wadehammes thanks for the tip.
although that means a complete refactor of our current code base, so still hoping that the contentful team are able to solve this.

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