Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Make size limit warning more prominent, don't preview when over limit #417

Closed
ashleymichal opened this issue Aug 9, 2019 · 6 comments
Closed
Labels
interface Issues or improvements to the interface timed out webpack Issues that involve the `webpack` bundler

Comments

@ashleymichal
Copy link
Contributor

The user report #393 included some unclear error messaging. The root of the problem was that the user's script exceeded the script size limit imposed by the Workers platform, however Wrangler could do a couple of things to improve the experience around this limit:

  1. Improve the error printed when build exceeds 1MB by printing the warning on a second line:
# instead of this:
✨ Built successfully, built project size is 1 MiB. ⚠️ Your built project has grown past the 1MiB size limit and may fail to deploy. ⚠️ ✨
# print this:
✨ Built successfully, built project size is 1 MiB. 
⚠️ Your built project has grown past the 1MiB size limit and may fail to deploy.
  1. Don't push to the preview service if the script size exceeds 1MB. The errors returned from the preview service are generally vague at this point, so it's best to simply not.
  2. Add a help message with suggestions for reducing script size, such as disabling source maps, turning on minification, and enabling performance hints. (This may make the most sense for webpack projects only).
@ashleymichal ashleymichal added feature Feature requests and suggestions good first issue Good for newcomers status - PR welcome webpack Issues that involve the `webpack` bundler labels Aug 9, 2019
@xortive
Copy link
Contributor

xortive commented Aug 9, 2019

with regard to 2: The 1mb limit we calculate is not done in the same way that the runtime does it... Simulating this exactly is difficult. I think catching the error and returning our own error may be helpful when running up against the size limit, but halting on our calculated limit could break people who's workers are up against the limit and work today.

@murraybauer
Copy link

Perhaps Cloudflare could increase the 1MB limit to 3MB to match StackPath.
This could give you some breathing room to align the platform limit and CLI limit without breaking anyone.
I say this seriously.

@ashleymichal ashleymichal added this to the wrangler build milestone May 14, 2020
@stale
Copy link

stale bot commented Jul 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Sep 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 11, 2020
@Electroid Electroid added interface Issues or improvements to the interface and removed feature Feature requests and suggestions good first issue Good for newcomers status - PR welcome labels Feb 22, 2021
@Electroid Electroid removed this from the wrangler build milestone Apr 16, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

@stale stale bot added the timed out label Jan 9, 2022
@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically closed because it has not had recent activity. You may re-open the issue if it is still relevant.

@stale stale bot closed this as completed Mar 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
interface Issues or improvements to the interface timed out webpack Issues that involve the `webpack` bundler
Projects
None yet
Development

No branches or pull requests

5 participants