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

Template typescript-webpack does not startup correctly #1378

Closed
3 tasks done
scflode opened this issue Jan 2, 2020 · 3 comments · Fixed by #1388
Closed
3 tasks done

Template typescript-webpack does not startup correctly #1378

scflode opened this issue Jan 2, 2020 · 3 comments · Fixed by #1388
Labels

Comments

@scflode
Copy link

scflode commented Jan 2, 2020

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version:
    • 6.0.0-beta.47
  • Electron Version:
    • 7.1.7
  • Operating System:
    • macOS 10.14.6
  • Last Known Working Electron Forge version::
    • n/a

Expected Behavior

After a fresh install with the typescript-webpack template the application should start without error.

Actual Behavior

The app does not start, only showing an alert box. The CLI shows:

$ electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Compiling Main Process Code
⠋ Launch Dev ServersStarting type checking service...
Using 1 worker with 2048MB memory limit
✔ Launch Dev Servers
✔ Compiling Preload Scripts
✔ Launching Application


Webpack Output Available: http://localhost:9000

App threw an error during load
Error: Module parse failed: Unexpected token (2:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { app, BrowserWindow } from 'electron';
> declare const MAIN_WINDOW_WEBPACK_ENTRY: any;
|
| // Handle creating/removing shortcuts on Windows when installing/uninstalling.
    at Object../src/index.ts (/Users/fs/Workspaces/playground/electronforge-typescript-webpack/.webpack/main/index.js:97:7)
    at __webpack_require__ (/Users/fs/Workspaces/playground/electronforge-typescript-webpack/.webpack/main/index.js:21:30)
    at /Users/fs/Workspaces/playground/electronforge-typescript-webpack/.webpack/main/index.js:85:18
    at Object.<anonymous> (/Users/fs/Workspaces/playground/electronforge-typescript-webpack/.webpack/main/index.js:88:10)
    at Module._compile (internal/modules/cjs/loader.js:880:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
    at Module.load (internal/modules/cjs/loader.js:735:32)
    at Module._load (internal/modules/cjs/loader.js:648:12)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
webpack built 8864fef2c8c472658968 in 3507ms

To Reproduce

The project was built via yarn create electron-app electronforge-typescript-webpack --template=typescript-webpack

Additional Information

n/a

@scflode scflode added the bug label Jan 2, 2020
@malept
Copy link
Member

malept commented Jan 3, 2020

I can't reproduce this on Linux, although I'm running yarn start instead of electron-forge start because otherwise you're using the globally installed version instead of the locally installed version, which may differ.

@scflode
Copy link
Author

scflode commented Jan 3, 2020

Thanks for reaching back. I just saw that there was something missing from the pasted output:

➜ yarn start
yarn run v1.21.1
$ electron-forge start
...

so I'm also running this via Yarn.

I made a yarn global upgrade before running the scaffolding. The Webpack config does also look OK. Unfortunately I wasn't able to find a way to dump what loaders are registered with Webpack.

The globally installed packages are:

➜ yarn global list
yarn global v1.21.1
info "[email protected]" has binaries:
   - create-electron-app
info "[email protected]" has binaries:
   - esy
✨  Done in 0.81s.

I tried to set it up multiple times to no success so far. I will test it on a fresh Linux install though to verify further.

@scflode
Copy link
Author

scflode commented Jan 3, 2020

I ran it on a VM with Ubuntu 19.04.

$ yarn global list
yarn global v1.17.3
Done in 0.15s.

No global stuff installed.

$ yarn create electron-app electronforge-typescript-webpack --template=typescript-webpack
yarn create v1.17.3
[1/4] Resolving packages...
warning create-electron-app > @electron-forge/cli > @electron-forge/core > nugget > progress-stream > through2 > xtend > [email protected]: 
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
warning Your current version of Yarn is out of date. The latest version is "1.21.1", while you're on "1.17.3".
info To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
success Installed "[email protected]" with binaries:
      - create-electron-app
✔ Initializing Project Directory
✔ Initializing Git Repository
✔ Locating custom template: "typescript-webpack"
✔ Copying Starter Files
✔ Initializing NPM Module
✔ Setting up Forge configuration
✔ Setting up TypeScript configuration
✔ Installing Template Dependencies
✔ Installing NPM Dependencies
Done in 131.37s.
$ yarn global list
yarn global v1.17.3
info "[email protected]" has binaries:
   - create-electron-app
Done in 1.45s.
$ yarn start
yarn run v1.17.3
$ electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Compiling Main Process Code
⠋ Launch Dev ServersStarting type checking service...
Using 1 worker with 2048MB memory limit
✔ Launch Dev Servers
✔ Compiling Preload Scripts
✔ Launching Application


Webpack Output Available: http://localhost:9000

App threw an error during load
Error: Module parse failed: Unexpected token (2:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { app, BrowserWindow } from 'electron';
> declare const MAIN_WINDOW_WEBPACK_ENTRY: any;
| 
| // Handle creating/removing shortcuts on Windows when installing/uninstalling.
    at Object../src/index.ts (/home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:97:7)
    at __webpack_require__ (/home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:21:30)
    at /home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:85:18
    at Object.<anonymous> (/home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:88:10)
    at Module._compile (internal/modules/cjs/loader.js:880:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
    at Module.load (internal/modules/cjs/loader.js:735:32)
    at Module._load (internal/modules/cjs/loader.js:648:12)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Module parse failed: Unexpected token (2:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { app, BrowserWindow } from 'electron';
> declare const MAIN_WINDOW_WEBPACK_ENTRY: any;
| 
| // Handle creating/removing shortcuts on Windows when installing/uninstalling.
    at Object../src/index.ts (/home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:97:7)
    at __webpack_require__ (/home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:21:30)
    at /home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:85:18
    at Object.<anonymous> (/home/fs/Workspaces/electronforge-typescript-webpack/.webpack/main/index.js:88:10)
    at Module._compile (internal/modules/cjs/loader.js:880:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
    at Module.load (internal/modules/cjs/loader.js:735:32)
    at Module._load (internal/modules/cjs/loader.js:648:12)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
webpack built 8864fef2c8c472658968 in 5931ms

malept added a commit that referenced this issue Jan 9, 2020
ts-loader was not being loaded for TypeScript files

ISSUES CLOSED: #1378
malept added a commit that referenced this issue Jan 9, 2020
…#1388)

ts-loader was not being loaded for TypeScript files

ISSUES CLOSED: #1378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants