merin83 / embeddable-create-react-app

Easily create an embeddable js widget using create react app
MIT License
9 stars 1 forks source link

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

Open McGroover-Bottleneck opened 4 years ago

McGroover-Bottleneck commented 4 years ago

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 commented 4 years ago

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

sgtpenguin commented 4 years ago

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 commented 3 years ago

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

adamduncan commented 2 years ago

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