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

Next.js: Applying augmentDocumentWithEmotionCache to document breaks AMP pages #203

Open
tiotdev opened this issue Nov 26, 2023 · 2 comments

Comments

@tiotdev
Copy link

tiotdev commented Nov 26, 2023

_document.js:

import Document from 'next/document';
import { augmentDocumentWithEmotionCache } from './_app';

//You can also pass your custom document if you have one.
augmentDocumentWithEmotionCache(Document);

export default Document;

Amp pages show TypeError: Cannot read properties of undefined (reading '__html')

Without tss-react no issues:

import Document from 'next/document';

export default Document;
@garronej
Copy link
Owner

Hello @tiotdev,

Thanks for reaching out. Would you produce a reproduction repo?

@garronej
Copy link
Owner

Well I tested with a next.js page router starter in vanilla javascript just to make sure it works.
Nothing to report.
image
image
image
image

Maybe try copy pasting precisely what ther's in the doc: https://docs.tss-react.dev/ssr/next.js

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