Skip to content

Commit e48ad97

Browse files
committed
Fix cannot find module issue
- Update local import with `.js` extension to comply with ES module rules on relative imports.
1 parent 14bdee1 commit e48ad97

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/main/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as path from 'path';
55
// eslint-disable-next-line import/no-extraneous-dependencies
66
import { BrowserWindow, app, ipcMain } from 'electron';
7-
import * as nodeEnv from '_utils/node-env';
7+
import * as nodeEnv from '_utils/node-env.js';
88

99
let mainWindow: Electron.BrowserWindow | undefined;
1010

src/preload/preload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
22
import { contextBridge } from 'electron';
3-
import ipcAPI from '_preload/ipc-api';
3+
import ipcAPI from '_preload/ipc-api.js';
44

55
contextBridge.exposeInMainWorld('ipcAPI', ipcAPI);

src/renderer/renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Import the styles here to process them with webpack
55
import '_public/style.css';
66

7+
import App from '_renderer/App.js';
78
import * as React from 'react';
89
import { createRoot } from 'react-dom/client';
9-
import App from '_renderer/App';
1010

1111
const container = document.getElementById('app');
1212
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

src/types/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declare global {
22
interface Window {
33
/** APIs for Electron IPC */
4-
ipcAPI?: typeof import('_preload/ipc-api').default
4+
ipcAPI?: typeof import('_preload/ipc-api.js').default
55
}
66
}
77

0 commit comments

Comments
 (0)