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

bug: HTTP request to http://localhost/emptyfile.css results in 404 #3312

Closed
asztal opened this issue Jul 22, 2020 · 1 comment
Closed

bug: HTTP request to http://localhost/emptyfile.css results in 404 #3312

asztal opened this issue Jul 22, 2020 · 1 comment

Comments

@asztal
Copy link
Contributor

asztal commented Jul 22, 2020

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 2.3.0

  @capacitor/core: 2.3.0

  @capacitor/android: 2.3.0

  @capacitor/electron: 2.3.0

  @capacitor/ios: 2.3.0

Installed Dependencies:

  @capacitor/electron not installed


  @capacitor/cli 2.0.1

  @capacitor/core 2.1.0

  @capacitor/android 2.1.0

  @capacitor/ios 2.1.0

Platform(s)

So far our QA team has only reported this issue on Android.

Current Behavior

It seems the capacitor local web server returns 404 status for empty files, even if the file exists, so I get an error to say the the CSS chunk load failed. With webpack and code splitting, this can prevent parts of the app from loading.

image

The file does exist in my bundle but is a blank file. My webpack build apparently produces some empty CSS files - why, I'm not sure, but if it affects me it could affect other users.

image

image

Expected Behavior

The return status should be 200 OK with Content-Length: 0.

Code Reproduction

Add an empty CSS file to your public directory. To your html file, add a <link rel="stylesheet" type="text/css" href="emptyfile.css">. You will notice that the request fails and the chrome Network Tools tab says that the response code is "404 OK".

Other Technical Details

npm --version output: 6.14.5

node --version output: v12.18.2

pod --version output (iOS issues only):

Additional Context

I guess the cause is this:
https://github.com/ionic-team/capacitor/blob/main/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java#L393

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants