Giter Site home page Giter Site logo

leo / electron-next-skeleton Goto Github PK

View Code? Open in Web Editor NEW
177.0 177.0 31.0 286 KB

An example Electron app built with Next.js

Home Page: https://leo.im/2017/electron-next

License: MIT License

JavaScript 100.00%
boilerplate electron nextjs renderer template

electron-next-skeleton's People

Contributors

appins avatar bhaveshgohel avatar bokuweb avatar bratsos avatar clemens-tolboom avatar fscherwi avatar galeksandrp avatar haacked avatar icodeforbananas avatar icoxfog417 avatar ionicabizau avatar izuzak avatar jlord avatar kevinsawicki avatar laiso avatar leo avatar louis993546 avatar phanect avatar posva avatar pratu16x7 avatar sahildua2305 avatar sergiodxa avatar tcyrus avatar thompsonemerson avatar zanesterling avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

electron-next-skeleton's Issues

TypeScript example

Does anyone know if there is there an example of using TypeScript with Electron and Next.js anywhere?

sh: bundle: command not found

sh: bundle: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] dist: npm run build && bundle
npm ERR! spawn ENOENT

I believe that I successfully ran this script before but somehow this happened and I can't figure out how to solve it.
Would highly appreciate any help

Production version not working

I did a clean clone of the repo, installed packages, then ran npm run dist.
When I open the webpage I get an error: Not allowed to load local resource: .../ElectronNext.app/Contents/Resources/app.asar/renderer/out/start/index.html

To fix this, i disabled web security on the mainBrowser window:

const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      webSecurity: false
    }
})

The error is gone, but now the app loads a blank screen.

What might be the problem?

`build` script fails when trying to use `getPath('userData')`

If you change the start.js file in master to the following:

import {app, remote} from 'electron'

const userDataPath = app ? app.getPath('userData') : remote.app.getPath('userData')

export default () => (
  <section>
      <p>{'This is Next.js speaking'}</p>
      <p>{`Your user data path is: ${userDataPath}`}</p>
  </section>
)

When you run npm run build, it will produce the following error.

> [email protected] build /Users/manovotny/Developer/electron-next-skeleton
> next build renderer && next export renderer

> Using "webpack" config function defined in next.config.js.
  using build directory: /Users/manovotny/Developer/electron-next-skeleton/renderer/.next
  exporting path: /start
TypeError: Cannot read property 'app' of undefined
    at Object.<anonymous> (/Users/manovotny/Developer/electron-next-skeleton/renderer/.next/dist/pages/start.js:15:88)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at _callee$ (/Users/manovotny/Developer/electron-next-skeleton/node_modules/next/dist/server/require.js:33:46)
    at tryCatch (/Users/manovotny/Developer/electron-next-skeleton/node_modules/next/node_modules/regenerator-runtime/runtime.js:65:40)

I think I am doing the if check for which app to use correctly because the page could be server or client rendered.

To be clear, npm start runs just fine without any errors. It's only when you try and build that it's unhappy.

I would appreciate any help or thoughts of what to try instead.

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.