microsoft / powerbi-visuals-webpack-plugin

powerbi-visuals-webpack-plugin
MIT License
33 stars 29 forks source link

assets/status returns empty mime type, fills console with "XML Parsing Error: syntax error" when auto-reload turned on. #63

Open despian opened 3 years ago

despian commented 3 years ago

Operating System: macOS 10.15.7 Browser: Firefox 88.0.1 (64-bit) Node Version: v12.18.1 powerbi-visuals-tools Version: 3.1.19 powerbi-visuals-webpack-plugin Version: 2.2.6

webpack-dev-server is unable to determine the correct mime type for the status file since there is no extension.

It returns the content header with no mime type: Content-Type: ; charset=UTF-8. By default, the browser treats this as text/html and tries to parse the content as HTML. This results in an "XML Parsing Error: syntax error" in the console.

When auto-reload is enabled the console gets filled with these errors, making it unusable for debugging/development.

image

I had a look at how webpack-dev-server determines the mime type and it doesn't seem possible to override it without an extension. The best option would probably be to just give the filename an extension e.g. status.txt it would then be served as text/plain and shouldn't trigger the XML parser error.