-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Some (but not all) static files fail to be served - ERR_CONTENT_LENGTH_MISMATCH #151
Comments
@jeremythille Hi! I've run into the same issue, and I'm wondering if you've found a workaround yet -- this is kind of a deal breaker... |
@ No, actually I tried to remove Opine altogether and serve my files just with Deno, without a library, and so far it works well |
Heya @xyzshantaram, @jeremythille 👋 Do you have a minimal reproduceable example / gist / repo that I can use to try and debug this issue? |
Ha, no sorry (and it's new year's eve, and then I'm going on a trip so I don't really have time to set up a repo now). But I've put my whole server code in my original question, apart from the Angular files which are really generic HTML/CSS/JS files. Thanks for looking into this issue, and of course, happy new year :) |
@jeremythille That will work for a bit, I suppose. |
@cmorten -- Here you go! https://github.com/xyzshantaram/opine-content-length-bug Sorry I couldn't work on it last year ;) |
Thanks for the great repro @xyzshantaram! I've identified the issue - with some of the changes moving to the new std/http server for I have an idea for a fix which can look into this afternoon 😄 The code has its own reader impl. which was needed originally, and to ensure resource cleanup this close loop was introduced. With the 2.0.0 changes we now use a readable stream for the response which is capable of closing the resource itself- suspect can bin off the hand rolled reader to fix the bug and also get a slight perf benefit 😄 |
Hey @jeremythille @xyzshantaram I've just released |
Hi Craig, thanks for the follow-up and the quick maintenance. Will try to
test it later today or tomorrow. Cheers
…On Sat, 1 Jan 2022 at 19:48, Craig Morten ***@***.***> wrote:
Hey @jeremythille <https://github.com/jeremythille> @xyzshantaram
<https://github.com/xyzshantaram> I've just released 2.0.2 which I
believe fixes the issue. If not please do reopen!
—
Reply to this email directly, view it on GitHub
<#151 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4JAIEL7HBPS7XWMI6LYGLUT5EBXANCNFSM5KI62V4A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ah, crap, I forgot to respond to this! @cmorten thanks a lot for the prompt fix, it worked perfectly! <3 |
For the record, I still haven't tried @cmorten's fix, because I'm still trying to code a little server using native Deno code (for learning purposes, I want to understand how Deno works before using libraries), and I have the same issue without Opine. For that matter, I have just opened a similar issue on Deno's repo: denoland/deno#13362 So... is it an Opine, or a Deno issue after all? :) EDIT It is a "me" issue! I forgot to encapsulate the inner |
Issue
Setup:
Details
I am using Opine to serve my Angular application's static files. Angular's "dist" folder contains :
My server code :
Result :
When I localhost:8090, some files get loaded, some don't :
No error in the terminal or in the browser's console. All that's displayed in my terminal is :
If I serve my Angular app with
ng serve
, it displays correctly.I can see the content of
index.html
,runtime.js
andstyles.css
in the browser's network tab.Not sure why some files are served correctly by Deno/Opine, and some (always these two) get
(failed)net::ERR_CONTENT_LENGTH_MISMATCH
EDIT
I noticed the two files that fail to be served are also the two heaviest of the lot. I have updated my question, adding the weight of each file, above. It looks like small files (7 KB, 1 KB, 2 KB) are being served normally, but heavier files (44 KB, 182 KB) get ERR_CONTENT_LENGTH_MISMATCH
The text was updated successfully, but these errors were encountered: