Skip to content

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

@tiotdev

Description

@tiotdev

_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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions