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(tsconfig): update module and moduleResolution to Node16 #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mefengl
Copy link

@mefengl mefengl commented Dec 9, 2024

Description

I applied this change in my project, and it fixed the electron-store type issue, so I’m making a PR here.

quote from cawa-93/vite-electron-builder#997 (comment) :

Hello 👋,

Thanks for this awesome template and the latest move to ESM. Great work so far!

When migrating my project to these latest changes I observed issues with the electron-store module. According to its maintainer, the .tsconfig of this template is not fully "ESM-compliant". They suggest to change the moduleResolution of the .tsconfig to node16 or nodenext. I have created a repository using this template to reproduce the problem: raphaelmenges/electron-store-type-error

Additional context

Have run pnpm typechecker found some type error like below, but it not bought by this commit, so leave it unfix.

pnpm typechecker errors
	packages/playground/src/main.mts:4:40 - error TS2307: Cannot find module '@electron-toolkit/utils' or its corresponding type declarations.
4 import { optimizer, electronApp } from '@electron-toolkit/utils'
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~

packages/playground/src/preload.mts:2:29 - error TS2307: Cannot find module '@electron-toolkit/preload' or its corresponding type declarations.

2 import { electronAPI } from '@electron-toolkit/preload'
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  packages/playground/src/main.mts:4
     1  packages/playground/src/preload.mts:2
 ELIFECYCLE  Command failed with exit code 2.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

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.

1 participant