You can read more about this concept here.
leo / electron-next-skeleton Goto Github PK
View Code? Open in Web Editor NEWAn example Electron app built with Next.js
Home Page: https://leo.im/2017/electron-next
License: MIT License
An example Electron app built with Next.js
Home Page: https://leo.im/2017/electron-next
License: MIT License
You can read more about this concept here.
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?
see link
Does anyone know if there is there an example of using TypeScript with Electron and Next.js anywhere?
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.
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
How might I be able to run code specifically in the renderer process, similar to https://github.com/ourcodeworld/electron-examples/blob/master/examples/electron-folderandfilewatcher/index.html ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.