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

fix(cli): add template-vite-typescript to Forge's core dependencies #3303

Merged
merged 1 commit into from
Aug 19, 2023

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Aug 19, 2023

Summarize your changes:

In order to install a template from the electron-forge init command, the template needs to be a dependency of the @electron-forge/core package.

Closes #3304

See:

success Installed "create-electron-app@6.4.0" with binaries:
      - create-electron-app
  electron-forge:init Initializing in: /Users/erick.zhao/640-test-app +0ms
[STARTED] Locating custom template: "vite-typescript"
  electron-forge:init:find-template Trying global template: electron-forge-template-vite-typescript +0ms
  electron-forge:init:find-template Error: get-installed-path: module not found "electron-forge-template-vite-typescript" in path /Users/erick.zhao/.nvm/versions/node/v16.20.1/lib/node_modules/electron-forge-template-vite-typescript +1ms
  electron-forge:init:find-template Trying global template: @electron-forge/template-vite-typescript +0ms
  electron-forge:init:find-template Error: get-installed-path: module not found "@electron-forge/template-vite-typescript" in path /Users/erick.zhao/.nvm/versions/node/v16.20.1/lib/node_modules/@electron-forge/template-vite-typescript +0ms
  electron-forge:init:find-template Trying local template: electron-forge-template-vite-typescript +0ms
  electron-forge:init:find-template Error: Cannot find module 'electron-forge-template-vite-typescript'
  electron-forge:init:find-template Require stack:
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/init-scripts/find-template.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/init.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/index.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/cli/dist/electron-forge-init.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/create-electron-app/dist/index.js +0ms
  electron-forge:init:find-template Trying local template: @electron-forge/template-vite-typescript +0ms
  electron-forge:init:find-template Error: Cannot find module '@electron-forge/template-vite-typescript'
  electron-forge:init:find-template Require stack:
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/init-scripts/find-template.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/init.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/index.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/cli/dist/electron-forge-init.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/create-electron-app/dist/index.js +1ms
  electron-forge:init:find-template Trying local template: vite-typescript +0ms
  electron-forge:init:find-template Error: Cannot find module 'vite-typescript'
  electron-forge:init:find-template Require stack:
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/init-scripts/find-template.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/init.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/core/dist/api/index.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/@electron-forge/cli/dist/electron-forge-init.js
  electron-forge:init:find-template - /Users/erick.zhao/.config/yarn/global/node_modules/create-electron-app/dist/index.js +0ms
[FAILED] Failed to locate custom template: "vite-typescript"
[FAILED]
[FAILED] Try `npm install -g @electron-forge/template-vite-typescript`

On a side note, asking users to install the template globally as a workaround could work, but seems like a very bad code smell.

@erickzhao erickzhao requested a review from a team as a code owner August 19, 2023 04:19
@erickzhao erickzhao requested a review from a team August 19, 2023 04:20
@erickzhao erickzhao merged commit 3d2e8d4 into main Aug 19, 2023
@erickzhao erickzhao deleted the fix/vite-typescript branch August 19, 2023 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FAILED] Failed to locate custom template: "vite-typescript"
3 participants