Giter VIP home page Giter VIP logo

Comments (4)

yhirose avatar yhirose commented on May 27, 2024

@licarth, thank you for the report. If I change the line in main.ts accordingly and run yarn electron:dev, then I got the following errors...

11:00:21 AM - Starting compilation in watch mode...
[1] 
[2] electron/main.ts(3,8): error TS1259: Module '"/Users/yhirose/Projects/react-typescript-electron-sample/node_modules/electron-is-dev/index"' can only be default-imported using the 'esModuleInterop' flag
[2] wait-on http://localhost:3000 && tsc -p electron && electron . exited with code 1
[1] electron/main.ts(3,8): error TS1259: Module '"/Users/yhirose/Projects/react-typescript-electron-sample/node_modules/electron-is-dev/index"' can only be default-imported using the 'esModuleInterop' flag
[1] 
[1] 11:00:23 AM - Found 1 error. Watching for file changes.

from react-typescript-electron-sample-with-create-react-app-and-electron-builder.

licarth avatar licarth commented on May 27, 2024

Yup, I faced the same problem, indeed. I had to add the esModuleInterop: true flag to my tsconfig.json. Anything against adding it ?

Because currently, yarn electron:build does not work properly on my machine without fixing the import: it builds a bundle for production with isDev returning true.

from react-typescript-electron-sample-with-create-react-app-and-electron-builder.

yhirose avatar yhirose commented on May 27, 2024

@licarth, I built a production package with yarn electron:build with the current code base, but isDev gives me false successfully on my Mac OS. (I confirmed the app doesn't show the DevTools window when the app starts.)

if (isDev) {
win.webContents.openDevTools();
}

I just wonder why the problem happens on your machine, but on my machine... Does my environment miss something?

from react-typescript-electron-sample-with-create-react-app-and-electron-builder.

licarth avatar licarth commented on May 27, 2024

Alright, my bad. Just checked out your project, tried to reproduce and could not. Let's close this, I'll try to find out why it's like that on my project, which I created from your recipe (I do have a slightly different tsconfig).

Sorry again, and thanks for having looked into it.

from react-typescript-electron-sample-with-create-react-app-and-electron-builder.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.