Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

npm run package shows empty screen #29

Open
recodyx opened this issue Apr 8, 2019 · 2 comments
Open

npm run package shows empty screen #29

recodyx opened this issue Apr 8, 2019 · 2 comments

Comments

@recodyx
Copy link

recodyx commented Apr 8, 2019

Hello,

after runing npm run build , a dist folder is created and contains files like bundle.js, bundle.css and index.html

But then, if I'm runing npm run prod I see only a blank screen. This happens because the generated index.html is empty:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Webpack App</title>
  <link href="./bundle.css" rel="stylesheet"></head>
  <body>
  <script type="text/javascript" src="./bundle.js"></script></body>
</html>

I believe the cause is index.js

import React from 'react';
import { render } from 'react-dom';
import App from './components/App';

// Since we are using HtmlWebpackPlugin WITHOUT a template, we should create our own root node in the body element before rendering into it
let root = document.createElement('div');
root.id = "root";
document.body.appendChild( root );

// Now we can render our application into it
render( <App />, document.getElementById('root') );

So we need a something like template (index.html) ? Or how can I fix the issue?

P.S. The same issue if I'm using npm run package

Regards
dit

@gabbersepp
Copy link

Hi,
i have used the commands you mentioned in both branches "master" and "develop". In both branches I see an active electron instance with some text. Is the Dev Console showing some errors?

@liPatrick
Copy link

@dit-j
We are having the same issue as you during packaging. Our suspicion is that the problem lies with the build path to our index.html:
dev
? 'http://localhost:8080?start'
: file://${__dirname}/../../dist/index.html?start'

Have you had any luck resolving this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants