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

Change moduleResolution to node16 or nodenext #997

Closed
raphaelmenges opened this issue May 12, 2024 · 2 comments · Fixed by #1000
Closed

Change moduleResolution to node16 or nodenext #997

raphaelmenges opened this issue May 12, 2024 · 2 comments · Fixed by #1000
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@raphaelmenges
Copy link
Contributor

raphaelmenges commented May 12, 2024

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: https://github.com/raphaelmenges/electron-store-type-error

The output of `npm run typecheck` is as follows:
$ npm run typecheck

> vite-electron-builder@2.0.0 typecheck
> npm run typecheck:main && npm run typecheck:preload && npm run typecheck:renderer


> vite-electron-builder@2.0.0 typecheck:main
> tsc --noEmit -p packages/main/tsconfig.json

packages/main/src/store.ts:5:7 - error TS2339: Property 'set' does not exist on type 'ElectronStore<Record<string, unknown>>'.

5 store.set('unicorn', '🦄');
        ~~~

packages/main/src/store.ts:6:19 - error TS2339: Property 'get' does not exist on type 'ElectronStore<Record<string, unknown>>'.

6 console.log(store.get('unicorn'));
                    ~~~

packages/main/src/store.ts:10:7 - error TS2339: Property 'set' does not exist on type 'ElectronStore<Record<string, unknown>>'.

10 store.set('foo.bar', true);
         ~~~

packages/main/src/store.ts:11:19 - error TS2339: Property 'get' does not exist on type 'ElectronStore<Record<string, unknown>>'.

11 console.log(store.get('foo'));
                     ~~~

packages/main/src/store.ts:14:7 - error TS2339: Property 'delete' does not exist on type 'ElectronStore<Record<string, unknown>>'.

14 store.delete('unicorn');
         ~~~~~~

packages/main/src/store.ts:15:19 - error TS2339: Property 'get' does not exist on type 'ElectronStore<Record<string, unknown>>'.

15 console.log(store.get('unicorn'));
                     ~~~


Found 6 errors in the same file, starting at: packages/main/src/store.ts:5
@raphaelmenges raphaelmenges added the bug Something isn't working label May 12, 2024
@raphaelmenges raphaelmenges changed the title Change moduleResolution to node16 or esnext Change moduleResolution to node16 or nodenext May 22, 2024
@cawa-93
Copy link
Owner

cawa-93 commented May 23, 2024

PR welcome

@cawa-93 cawa-93 added help wanted Extra attention is needed good first issue Good for newcomers labels May 23, 2024
@raphaelmenges
Copy link
Contributor Author

raphaelmenges commented Jul 26, 2024

@cawa-93 can you have a look at the PR? 👉👈

I am really interested in your opinion on how to handle the .js extension decision!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants