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

Can't get the simplest of react apps rendering #2

Open
McGroover-Bottleneck opened this issue Dec 19, 2019 · 4 comments
Open

Can't get the simplest of react apps rendering #2

McGroover-Bottleneck opened this issue Dec 19, 2019 · 4 comments

Comments

@McGroover-Bottleneck
Copy link

I have the minimum hello world like so

import React from 'react';
import ReactDOM from 'react-dom';

console.log('Bundle loading')
ReactDOM.render(
    <h1>Hello, world!</h1>,
    document.getElementById('root')
  );

I then have a simple index.html

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="theme-color" content="#000000" />
  <meta name="description" content="Web site created using create-react-app" />
  <link rel="apple-touch-icon" href="logo192.png" />

  <title>React App</title>
</head>

<body>
  <noscript>You need to enable JavaScript to run this app.</noscript>
  <div id="root"></div>
  <script src="../dist/build/static/js/bundle.min.js"></script>
</body>

</html>

This should simple render a Hello World but doesnt!

What am I doing wrong?

@mhmo91
Copy link

mhmo91 commented May 20, 2020

a note for anyone who comes here, don't waste your time with this, it doesn't work

@sgtpenguin
Copy link

It seems that react-scripts is breaking it. It works with react-scripts 3.1.1 but fails silently on the current release, react-scripts 3.4.1. 3.3.0 was released 2019-12-04, 15 days before the issue. That's all I got.

@SeverColhonAccesa
Copy link

any plans for fixing this with the current react-scripts version?

@adamduncan
Copy link

Appreciate stumbling upon your responses here, as I couldn't get this approach working with CRA v4 either.

Eventually arrived here, FWIW: https://stackoverflow.com/a/69945841/7000394

Hope that helps

Repository owner deleted a comment Feb 2, 2024
Repository owner deleted a comment from mkproject-admin Feb 21, 2024
Repository owner deleted a comment from H4wk-eye Feb 21, 2024
@github-staff github-staff deleted a comment from 1291945816 Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@adamduncan @mhmo91 @sgtpenguin @McGroover-Bottleneck @SeverColhonAccesa and others