Cypress w/ Shopify - Error: Content-Length can't be present with chunked encoding
See original GitHub issueCurrent behavior
When locally testing Shopify themes whose storefronts are password-protected, Cypress tests fail almost immediately with the following error:
cy.visit() failed trying to load:
https://localhost:3000/?preview_theme_id=120240898208
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: Parse Error: Content-Length can't be present with chunked encoding
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
Desired behavior
Cypress should load the storefront landing page normally when visiting: https://localhost:3000/?preview_theme_id=120240898208
Test code to reproduce
I have created a repo with instructions on how to set everything up to recreate the issue.
https://github.com/paxsolutions/cypress-shopify-issue
Versions
Cypress - v6.5.0 Chrome - v88.0.4324.192 Node - v14.4.0 macOS Big Sur
I understand there are several technologies in play here, still, any guidance is greatly appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Technical Q&A - Page 577 - Shopify Community
Hello everyone. Does anyone know how to increase the homepage header text size on warehouse theme without increasing the base text size? The...
Read more >Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error
Thus, the server did not send the terminal 0-length chunk - which was the problem ... Setting Content-Encoding header to identity solved this...
Read more >Gatsby Changelog | 5.3.0
Gatsby printed the complete contents of the page data to the terminal. ... type beside the error ID now; gatsby : Sanitize length...
Read more >Solved: How about is "transfer-encoding:chunked" support
Current code has a critical BUG in string check part. So WICED client cannot receive contents if the contents have string "Transfer-Encodeing :...
Read more >Building Integration Tests for Shopify Themes with Cypress
This past June, Michael Shannon (Co-Founder of Pixelcabin) gave an excellent talk at Shopify Unite—with a full overview of Pixelcabin's ...
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 Free
Top 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
This is a problem with the existing backend. For what it’s worth, NGINX setting chunked_transfer_encoding off; did the trick for me.
@paxsolutions not sure how you locally develop Shopify (used to be online only), but you might try proxying through NGINX or similar software and try and set the headers not to use chunked encoding.
@sirtawast unfortunately it doesn’t help in my case which is described here: https://github.com/cypress-io/cypress/issues/1185#issuecomment-856745211