Skip to content

Getting errors while trying to added a Material Ui component with AMP #911

@kiraahmad

Description

@kiraahmad

I made a very simple page to test AMP with Material UI and Next JS, However, when I try to render this page

import React from 'react'
import Button from '@material-ui/core/Button'

const testamp = () => {
return (
<div>
Hello World
<Button >
LOGIN
</Button>
</div>
)
}
export default testamp
export const config = { amp: true }

I get the following error:

/testamp error The parent tag of tag 'style amp-custom' is 'div', but it can only be 'head'.
error The parent tag of tag 'style amp-custom' is 'div', but it can only be 'head'.
error The parent tag of tag 'style amp-custom' is 'button', but it can only be 'head'.

what could be the problem here ? specially that I just added a very simple component here with no styling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions