DEV Community

Discussion on: Electron with Typescript using ts-node

Collapse
 
xemanet profile image
xemanet

Hi!

This app will have to work in a Pc windows that has installed a business management application(BMA) with mysql and apache(nginx). The user has a online shop in internet(mysql) and this app will manage actualized regs between BMA and Online Shop.(Clients, orders, products and products' images).
This app contains a poolling loop(4 timers) when opening it that run on , Socket.io to comunicate with user in react page, mongodb for store logs in pc and default values(mongodb) that user can modify with comunicate with databases with get and post of express.

I have separate server and client, and webpack compile in dist folder.

All run correctly in development and production.
The next step was integrate electron in app and this is the problem.

All app was write in nodejs javascript with babel and babel node for run it to use imports instead of require, and with errors of electron I opted to change the code to Typescript(much better of course) but the errrors continue.
If in main entry of pckage.jsfor I indicate dist/client.js, electron send error "document is not defined". If I indicate production.ts send error in imports Unexpected identifier.

I'm a bit lost and I do not find much on the internet.
Can you give me some information about it?

Thank you very much for answering!!

Thread Thread
 
michaeljota profile image
Michael De Abreu

You want to bundle the React app into Electron, so you would probably need to do just that. Have you try to create an Electron application before? The tutorial is very useful for a first app. :).

Thread Thread
 
xemanet profile image
xemanet

ok, thanks for your help.