Using amp with emotionjs, throws amp-validator errors.
See original GitHub issueBug report
Describe the bug
Using css-in-js solutions, throws errors with amp-validator, speciefly this one:
The parent tag of tag 'style amp-custom' is 'div', but it can only be 'head'
I’m using chakra-ui, which is based on emotion-js
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- git clone https://github.com/yassinebridi/amp-chakra
- yarn install && yarn dev.
- see errors in the console.
Expected behavior
For the amp-validator to pass
System information
- OS: Arch linux
- Browser : Chrome 81
- Version of Next.js: 9.4.0
- Version of Node.js: 14.2.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
AMP Validation Errors and Solutions - AMP Tutorials
I was trying my best to help everyone by fixing their validation issues manually in search console. I must have validated hundreds of...
Read more >Validate AMP pages - amp.dev
The AMP Validator comes bundled with the AMP JS library, so it is available on every AMP page out of the box. To...
Read more >Upgrade Guide - Next.js
This new parser has improved handling of CSS and now errors when invalid CSS is used that would previously slip through and cause...
Read more >Parsing error : Cannot find module 'next/babel' - Stack Overflow
js project that I create. The page can be compiled without any problem, it just keeps on showing as error on the first...
Read more >next - npm
Start using next in your project by running `npm i next`. ... AMP Behavior with next export; Adding AMP Components; AMP Validation; TypeScript...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found out the problem was with the chakra provider, in the _app.tsx, especially the
<CSSReset />
component, so i just conditionally render it depending on whether the page is amp or not:please close this if you think it’s unrelated to nextjs.
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.