custom-electron-titlebar icon indicating copy to clipboard operation
custom-electron-titlebar copied to clipboard

Cannot import `custom-electron-titlebar/main` using TypeScript's `import`

Open N3wSk1Y opened this issue 3 years ago • 3 comments

I can't import something from custom-electron-titlebar/main using TypeScript's import

import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";
Cannot find module 'custom-electron-titlebar/main' or its corresponding type declarations.

N3wSk1Y avatar May 31 '22 07:05 N3wSk1Y

import it's not from TypeScript. It's from ES6-Syntax.

DerGoogler avatar Jun 01 '22 20:06 DerGoogler

Same problem here. Using electron-forge project, but I upgraded to latest typescript compiler as older version didn't support the export field in the package.json. This fixed my import in of custom-electron-titlebar in preload but seeing the same error reported here with the main import.

Krelborn avatar Jun 28 '22 12:06 Krelborn

The package is missing dist/main.d.ts. Temporary fix is to put this in a .d.ts:

import type cetMain from "custom-electron-titlebar/dist/main/main";

declare module "custom-electron-titlebar/main" {
  const exports: cetMain;
  export default exports;
}

nexensys avatar Jul 22 '22 22:07 nexensys

I've just installed 4.1.2 and the issue still exists.

kairauer avatar Nov 16 '22 06:11 kairauer

I've just installed 4.1.2 and the issue still exists.

Yes, checking is an error by file name Fixed on 4.1.3

AlexTorresDev avatar Nov 16 '22 13:11 AlexTorresDev