Code Monkey home page Code Monkey logo

electron-typescript-example's Issues

Example how to use TypeORM with Electron using TypeScript

Hello guys, TypeORM is no more working with Electron?

I clone this link https://github.com/typeorm/electron-typescript-example

and run for download dependencias and when I start i got this error:

App threw an error during load C:\Users\Acer\Desktop\once\electron-typescript-example\node_modules\typeorm\node_modules\chalk\source\index.js:106 ...styles, ^^^ SyntaxError: Unexpected token ... at createScript (vm.js:74:10) at Object.runInThisContext (vm.js:116:10) at Module._compile (module.js:533:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\Acer\Desktop\once\electron-typescript-example\node_modules\typeorm\platform\PlatformTools.js:7:39)

Production build

Hi, I need to know how to build this example into production app like .exe?

I have run

electron-builder build --win --x64

But throws an error

 • electron-builder version=20.19.1
  • description is missed in the package.json appPackageFile=C:\Users\Romsy\Documents\Code\Test\electron-typescript-example\package.json
  • writing effective config file=dist\electron-builder-effective-config.yaml
  • rebuilding native production dependencies platform=win32 arch=x64
  • rebuilding native dependency name=sqlite3
  • packaging       platform=win32 arch=x64 electron=1.8.7 appOutDir=dist\win-unpacked
Error: Application entry file "index.js" in the "C:\Users\Romsy\Documents\Code\Test\electron-typescript-example\dist\win-unpacked\resources\app.asar" does not exist. Seems like a wrong configuration.

I just want to make sure that this example will have no error after release build.
Because I have an app that follows along the way with how this app works but only works on development mode, when I run on release build its error says that Cannot find module typeorm. Maybe because this line

<script>
var typeorm = require("typeorm");
I'm not sure.

create typeORM before electron main process init.

Dear dev, I have read this repo, and I found bellow code:

setTimeout(() => {
console.log("You can also get posts from the second process:");
createConnection().then(async connection => {
const posts = await connection.getRepository("Post").find();
console.log("posts:", posts);
});
}, 5000);

Actually, I want to use the database data like width and height to init BrowserWindow, Cloud I init TypeORM before we create BrowserWindow?


I try put init typeOrm before or after createWindow function, there always error like:

41901627717739_ pic

Doesn't work, throws a Syntax Error

If I run this, I get:

App threw an error during load
electron-typescript-example/node_modules/cli-highlight/node_modules/chalk/source/index.js:103
	...styles,
	^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (electron-typescript-example/node_modules/cli-highlight/dist/theme.js:10:28)

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.