Comments (4)
@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.
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.
@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.)
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.
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)
- Issue with electron:dev script. HOT 1
- `'BROWSER' is not recognized as an internal or external command` HOT 2
- build for apple m1 HOT 3
- package-lock.json resolves all dependencies to repo packages.bethel.jw.org HOT 2
- preload issue HOT 1
- Images inside electron/ are not copied over to build/ HOT 2
- How to use ipcRenderer and ipcMain? HOT 4
- error occurs after hot reload HOT 3
- What is the https://packages.bethel.jw.org in the yarn.lock? HOT 2
- Missing npx cmd into README.md file
- × TypeError: fs.existsSync is not a function HOT 10
- when i change main.ts throw error flash back window HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-typescript-electron-sample-with-create-react-app-and-electron-builder.