electron-userland / electron-forge-templates

Templates bundled with Electron Forge <= 5 to create Electron apps using popular JavaScript frameworks
107 stars 23 forks source link

Initial Start for react-typescript fails #23

Closed EldoranDev closed 7 years ago

EldoranDev commented 7 years ago

Please describe your issue:

Initial Start of the react-typescript template fails.

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.
Uncaught TypeError: Cannot read property 'unmountComponent' of null
    at ReactCompositeComponentWrapper.performInitialMountWithErrorHandling (<path>/my-new-project/node_modules/react-dom/lib/ReactCompositeComponent.js:327:30)
    at ReactCompositeComponentWrapper.mountComponent (<path>/my-new-project/node_modules/react-dom/lib/ReactCompositeComponent.js:256:21)
    at Object.mountComponent (<path>/node_modules/react-dom/lib/ReactReconciler.js:46:35)
    at ReactCompositeComponentWrapper.performInitialMount (<path>/my-new-project/node_modules/react-dom/lib/ReactCompositeComponent.js:371:34)
    at ReactCompositeComponentWrapper.mountComponent (<path>/my-new-project/node_modules/react-dom/lib/ReactCompositeComponent.js:258:21)
    at Object.mountComponent (<path>/my-new-project/node_modules/react-dom/lib/ReactReconciler.js:46:35)
    at mountComponentIntoNode (<path>/my-new-project/node_modules/react-dom/lib/ReactMount.js:104:32)
    at ReactReconcileTransaction.perform (<path>/my-new-project/node_modules/react-dom/lib/Transaction.js:140:20)
    at batchedMountComponentIntoNode (<path>/my-new-project/node_modules/react-dom/lib/ReactMount.js:126:15)
    at ReactDefaultBatchingStrategyTransaction.perform (<path>/my-new-project/node_modules/react-dom/lib/Transaction.js:140:20)

*Console output when you run electron-forge init with the environment variable `DEBUG=electron-forge:`. (Instructions on how to do so here). Please include the stack trace if one exists.**

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +20ms
  electron-forge:runtime-config setting key: verbose to value: false +9ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Locating Application +0ms
  electron-forge:project-resolver searching for project in: <path>/my-new-project +2ms
  electron-forge:project-resolver electron-forge compatible package.json found in <path>/my-new-project/package.json +7ms
  electron-forge:lifecycle Process Succeeded: Locating Application +1ms
  electron-forge:lifecycle Process Started: Preparing native dependencies +1ms
  electron-forge:lifecycle Process Succeeded: Preparing native dependencies +98ms
  electron-forge:lifecycle Process Started: Launching Application +1ms
  electron-forge:lifecycle Process Succeeded: Launching Application +4ms
2017-03-09 12:07:37.519 Electron Helper[46671:1123231] Couldn't set selectedTextBackgroundColor from default ()

What command line arguments are you passing?

DEBUG=electron-forge:* electron-forge start

What does your config.forge data in package.json look like?

{
"make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {},
      "electronWinstallerConfig": {
        "name": "my_new_project"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "mynewproject"
      }
}

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem.


npm install -g electron-forge

electron-forge init my-new-project --template=react-typescript

cd my-new-project

electron-forge start
philcleveland commented 7 years ago

I am having the same problem. I am running it on Ubuntu 16.04. Regular react (jsx) template is working fine for me.

EldoranDev commented 7 years ago

I can confirm for Windows 7, Windows 10 and OSX

malept commented 7 years ago

Yeah, this probably isn't OS-specific. But React isn't my area of expertise so I'll defer to one of the other devs.

MarshallOfSound commented 7 years ago

Think I've got this one figured out, testing now 👍

philcleveland commented 7 years ago

Cool. I was playing with versions in package.json and that didn't help. As a side note the @types/react could be updated. The typescript devDependency also doesn't match the Dependency version. Not sure if that is intentional.