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.

`serve -s build` not sending gzip-ed files to the browser.

See original GitHub issue

Is this a bug report?

Maybe, issue is with the dependency; more for tracking visibility of serve -s build

I installed create-react-app on a mac on October 28th. My current version of serve:

serve --version
10.0.2 

Maybe a solution for this problem is temporarily locking in a version of serve that did support gzip. looks like this issue and this pr from the serve repo. (If I figure out the version that has gzip support I will post the update.)

Expected Behavior

gzip-difference

Actual Behavior

The serve dependency is not sending gzip-ed files to the browser. cra-example

Related to 1908. Running command, npm run build; serve -s build

Documented further on their issues page, https://github.com/zeit/serve/issues/460

I have a current workaround in that I am manually gzip-ing the files and using express-static-gzip

Here are the files from my workaround so that I could do prod build without ejecting:

  1. “alternative” script in package.json
  2. “server.js” file for express
  3. Also notice I had to add express and express-static to the package.json

Eager to hear other alternatives for solving the problem. Happy to provide additional information or help in anyway.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ketysekcommented, Nov 11, 2018

I have an app in docker a this was the easiest way to serve it. Should I change the server to something else or will it be resolved?

1reaction
miraagecommented, Oct 30, 2018

You **may** serve it with a static server means “you can try to see how your apps works after being built for production usage”. Just think about what app would serve faster: the one which was written in C++ or NodeJS?

If you want to use heroku you don’t need to use the serve package. Link with instructions for heroku deployment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to compress build with/without ejecting create-react-app ...
Is there any way to apply gzip compression to build files and include gzipped files into index.html and deploy it on aws so...
Read more >
Can't send to compressed (zipped) folder - Server Fault
Currently our student's aren't able to send to - compressed folder. When trying the error 'File not found or no read permission' appears....
Read more >
ServiceNow Community servicenow community
I have a issue with upload zip file. The API Attachement /api/now/attachment/file uploaded the file to ServiceNow. After that, the content-type of this...
Read more >
WebGL build doesn't load in browser - Unity Forum
I'm creating a fresh URP project using Unity 2020.1.1f1. Then I build a WebGL project and zip the output files so that .zip...
Read more >
Reactjs Build Production: Optimize Performance - CopyCat Blog
While working on the app locally, this slowdown may be acceptable. But during deployment, this is not something we can afford. According to...
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