question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress w/ Shopify - Error: Content-Length can't be present with chunked encoding

See original GitHub issue

Current 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:open
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
sirtawastcommented, Apr 8, 2021

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.

#1185

This might be related.

I have similar issue with a certain webpack bundle / browser-sync configuration, wpack.io to be exact.

I can get the page to render by adding an additional header at NGINX, which servers the PHP upstream.

server {
  ...
  add_header transfer-encoding identity;
  ...
}

I might try using HTTPS and HTTP/2 so that transfer-encoding: chunked won’t be there anymore, as per HTTP/2 spec.

0reactions
Sawthiscommented, Oct 18, 2021

@sirtawast unfortunately it doesn’t help in my case which is described here: https://github.com/cypress-io/cypress/issues/1185#issuecomment-856745211

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found