electron-userland / electron-prebuilt-compile

electron-prebuilt with Babel and React built-in
168 stars 56 forks source link

Uncaught SyntaxError: Unexpected identifier #74

Open imran-saleem834 opened 5 years ago

imran-saleem834 commented 5 years ago

In console got this error, react is not working with that

imran-saleem834 commented 5 years ago
screen shot 2018-12-24 at 7 45 38 pm

here is output here window

imran-saleem834 commented 5 years ago
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Hello World! 23</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
</head>

<body id="host">
<script type="application/javascript">
    import React from 'react';
    import ReactDOM from 'react-dom';
    import TodoApp from './components/TodoApp';

    ReactDOM.render(React.createComponent(TodoApp), document.getElementById('host'));
</script>

</body>
</html>
imran-saleem834 commented 5 years ago
{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^3.0.13",
    "electron-prebuilt-compile": "^4.0.0-beta.X"
  },
  "dependencies": {
    "react": "^16.7.0",
    "react-dom": "^16.7.0"
  }
}
akkuankka commented 5 years ago

I'm having a similar issue, although the result is somewhat different. My issue involves the same import error occurring in the cli.js file. At line 3: import electron from 'electron'; I believe what this means is somewhere along the line ECMAScript is not being included. Which is weird, because I believe theoretically electron accepts ECMAScript natively. However this may have something to do with the fact that I manually inserted 4.0.0beta to my project instead of waiting for it to be available through npm.