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.

version 0.4.1 serves non-HTML files as text/html

See original GitHub issue

my index.html file needs to load some CSS and JS files directly which worked fined in previous releases but not with react-scripts version 0.4.1 because they are served with wrong content-type text/html.

These files cannot be loaded using import statements in JS files due to various issues caused by some obscure differences between two approaches.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:28 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
gaearoncommented, Sep 9, 2016

I don’t know what compelling benefits requiring webpack loader-based inclusions brings to create-react-app users and developers but I think it’s a glaring flaw in an otherwise wonderful developer tool.

Content hashing works correctly. If you update your jQuery plugin, an old version won’t be accidentally cached by your users.

If you use code splitting, you can delay loading jQuery and plugin code until you actually load the component using it, without writing any complicated code to inject scripts dynamically. Thanks to Webpack.

Same for any other asset types. Images get correct hashes automatically.

If you link to an image, and that image gets deleted, you will get a compile time error rather than a 404 in the app.

There are numerous benefits 😉

1reaction
sladkovmcommented, Sep 24, 2016

Thanks! d3.csv import also works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content is not loading because its MIME type, "text/html" is not ...
I think problem might be server.js file cannot access properly build folder of the frontend/client . Can you delete all of this:
Read more >
Rendering HTML Pages as an HTTP Server Response Using ...
In this article, we will consider the various approaches to rendering an HTML page. We will create a Node.js server using Express.js and ......
Read more >
HTML Service: Create and Serve HTML | Apps Script
Create HTML files​​ Within the HTML file, you can write most standard HTML, CSS, and client-side JavaScript. The page will be served as...
Read more >
Chapter 5 Web Servers | Introduction to Web Mapping
Let's try using a static HTTP server to serve a web page consisting of multiple files over the network. Locate and download the...
Read more >
htmltools.pdf
Version 0.5.4. Description Tools for HTML generation and output. ... create other non HTML/SVG tags, use the lower-level tag() constructor.
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