Skip to content

Avoid sending internal error messages to client#7526

Closed
lucleray wants to merge 1 commit intovercel:canaryfrom
lucleray:patch-4
Closed

Avoid sending internal error messages to client#7526
lucleray wants to merge 1 commit intovercel:canaryfrom
lucleray:patch-4

Conversation

@lucleray
Copy link
Member

@lucleray lucleray commented Jun 6, 2019

With the current implementation of the api "express-like api", we are sending errors that are not caught in user land back to the client.

This PR aims at fixing this.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2019

Stats from current PR

Click to expand stats
zeit/next.js canary lucleray/next.js patch-4 Change
Build Duration 14.8s 14.8s -18ms
node_modules Size 41.2 MB 41.2 MB -42 B
Total Bundle (main, webpack, commons) Size 210 kB 210 kB
Total Bundle (main, webpack, commons) gzip Size 68.8 kB 68.8 kB
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _error Size 8.81 kB 8.81 kB
Client _error gzip Size 3.31 kB 3.31 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.76 kB 4.76 kB
Client pages/link gzip Size 2.06 kB 2.06 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 24.3 kB 24.3 kB
Client main gzip Size 7.98 kB 7.98 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.5 kB 59.5 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 810 kB 810 kB
Click to expand serverless stats
zeit/next.js canary lucleray/next.js patch-4 Change
Build Duration 15.7s 16s ⚠️ +310ms
node_modules Size 41.2 MB 41.2 MB -42 B
Total Bundle (main, webpack, commons) Size 210 kB 210 kB
Total Bundle (main, webpack, commons) gzip Size 68.8 kB 68.8 kB
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _error Size 8.81 kB 8.81 kB
Client _error gzip Size 3.31 kB 3.31 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.76 kB 4.76 kB
Client pages/link gzip Size 2.06 kB 2.06 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 24.3 kB 24.3 kB
Client main gzip Size 7.98 kB 7.98 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.5 kB 59.5 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Serverless pages/link Size 339 kB 339 kB
Serverless pages/link gzip Size 87.2 kB 87.2 kB
Serverless pages/index Size 331 kB 331 kB
Serverless pages/index gzip Size 84.7 kB 84.7 kB
Serverless pages/_error Size 330 kB 330 kB
Serverless pages/_error gzip Size 84.5 kB 84.5 kB ⚠️ +1 B
Serverless pages/routerDirect Size 331 kB 331 kB
Serverless pages/routerDirect gzip Size 84.7 kB 84.7 kB -1 B
Serverless pages/withRouter Size 331 kB 331 kB
Serverless pages/withRouter gzip Size 84.7 kB 84.7 kB -1 B
Build Dir Size 2.37 MB 2.37 MB

@lfades
Copy link
Member

lfades commented Jun 6, 2019

@huv1k I like this, can you confirm that this may not break anything 🙏

Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be tested to avoid re-adding it in the future.

@Timer Timer removed the request for review from dav-is July 16, 2019 19:43
@Timer Timer added this to the 9.0.3 milestone Jul 16, 2019
@Timer Timer closed this in #8005 Jul 17, 2019
Timer pushed a commit that referenced this pull request Jul 17, 2019
* Avoid sending user error to client Closes #7526

* Small improvments

* Update sending errors
ijjk pushed a commit to ijjk/next.js that referenced this pull request Jul 23, 2019
* Avoid sending user error to client Closes vercel#7526

* Small improvments

* Update sending errors
@vercel vercel locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants