Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptic error when a snapshot is too large #4

Open
jaller94 opened this issue Dec 16, 2019 · 0 comments
Open

Cryptic error when a snapshot is too large #4

jaller94 opened this issue Dec 16, 2019 · 0 comments

Comments

@jaller94
Copy link
Contributor

jaller94 commented Dec 16, 2019

const { uploaded } = JSON.parse(body); // body is json

For the line above the API (/build/upload/snapshot) responded with a non-JSON answer.

My HTML snapshot was 1.530.769 bytes large, because the CSS was inserted inline.

Error

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Client.uploadSnapshot (/home/jaller94/Git/kiprotect/kiprotect-app/node_modules/@getbasset/node-client/lib/client.js:87:31)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Basset.uploadSnapshotFile (/home/jaller94/Git/kiprotect/kiprotect-app/node_modules/@getbasset/node-client/lib/basset.js:71:5)

Code submitting the snapshots

export BASSET_APP_URL=https://app.basset.io
export BASSET_TOKEN=*REDACTED*

My upload code is copied from this file:
https://github.com/basset/basset/blob/200088fe30353c0eeedfb1e824c9ac8a38e92aa2/express/tests/selenium/config/snapshots.js#L68-L88

Actual network response

With the HTTP code 413 I got the following response:

<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>openresty/1.15.8.2</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant