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

RollupError: Unexpected character '�' #136

Open
clck-dr opened this issue Apr 26, 2024 · 1 comment
Open

RollupError: Unexpected character '�' #136

clck-dr opened this issue Apr 26, 2024 · 1 comment

Comments

@clck-dr
Copy link

clck-dr commented Apr 26, 2024

I want to use node-activex in an vite-electron-react app. Rollup throws an error on build and dev:

[commonjs--resolver] node_modules/winax/build/Release/node_activex.node (1:2): Unexpected character ''

Node: 20.12.2
Electron: 30.0.1

I did rebuild with follwoing command:

npm rebuild --runtime=electron --version=30.0.1 --disturl=https://electronjs.org/headers --arch=x64 --build-from-source winax

Here is the referneced code:

import winax from "winax";

export function closePowerPoint(): void {
  try {
    const PowerPointApp = winax.Object("PowerPoint.Application");
    PowerPointApp.Quit();
    console.log("PowerPoint wurde erfolgreich geschlossen.");
  } catch (error) {
    console.error("Fehler beim Schließen von PowerPoint:", error);
  }
}

Has anyone an idea about this error?

@otryshko
Copy link

I had to add the winax to rollup vite.config as per https://electron-vite.github.io/guide/cpp-addons.html

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

No branches or pull requests

2 participants