Repository electron-template

FerVillanuevas

FerVillanuevas posted a new question

electron-template • a month ago

I cant use remote

i'm noob, just wanna close the app without frame

this is my code

<script> const remote = require('electron').remote export default { methods: { close () { remote.getCurrentWindow().close() } } } </script>

need some help please

braivre

braivre posted a new question

electron-template • 2 months ago

Create a Vue prototype in main.js

I want to use knexjs in my components and the only way I made it to work is creating the knexjs instance in the main.js (I also tried to do it in a plugin, but knex failed to run).
I realize that in the main.js there is a nuxt variable, so maybe is there a way to create a prototype and put the knexjs instance there? Something like this:
const nuxt = new Nuxt(config)
Vue.prototype.$knex = myknexinstance

skye-va

skye-va posted a new question

electron-template • 3 months ago

App just displays a white screen

Although everything looks fine when I run locally at http://localhost:3000/, the app that is built with Electron is just a blank white screen. I feel like I'm missing something obvious here!

esindger

esindger posted a new question

electron-template • 3 months ago

Electron Security Warning (Insecure Resources)

Hello, is there any way to fix this warning?
2018-05-12 11 44 55

Atinux

Atinux resolved the question #c4

electron-template • 4 months ago

do not open port in production

Hi @alidcastano

Actually next export is the equivalent of nuxt generate, but I believe server-side rendering is pretty useless in an Electron app, and by forcing the mode: spa, it will allow to avoid opening a port in production by serving the dist/ folder :)

yuchonghua

yuchonghua posted a new question

electron-template • 4 months ago

Use registerStreamProtocol and nuxt.render
git clone https://github.com/ddvjs/electron-test.git
cd electron-test
npm i
npm run dev
yuchonghua

yuchonghua posted a new question

electron-template • 4 months ago

do not open port in production,Use registerStreamProtocol and nuxt.render
git clone https://github.com/ddvjs/electron-test.git
cd electron-test
npm i
npm run dev
HoraceKeung

HoraceKeung posted a new question

electron-template • 4 months ago

I put together a new template

After understanding the nuxt starter template, this template and electron-quick-start template, I managed to put together a new template for vue-cli: https://github.com/HoraceKeung/nuxtron

Since there are differences compare to this template, for example the repo structure is so different since it is a template for creating new project via vue-cli and electron-builder is used by default to build the app, it may not a be a good idea to submit a pull request here. Any idea?

alexandesigner

alexandesigner posted a new question

electron-template • 7 months ago

[Question] Using this project

Today to use this repository it is necessary to make a clone, why not add it to vue-cli so that users can only start it with vue init nuxt-community/electron-template <folder>, there is some restriction so you have not done so?

If it is the case I can send a PR with the changes

alidcastano

alidcastano posted a new question

electron-template • 9 months ago

do not open port in production

Stumbled upon this article on how the Zeit team integrated Nex with Electron:
https://leo.im/2017/electron-next

One consideration they mention is not to open a port in production due to security vulnerabilities:

The reason why electron-next doesn't have the same behaviour in the final app as in development is that opening a port (like Next.js does it for providing hot reloading and auto-building of your code) is generally not a good idea because it introduces a security vulnerability on the user's device.

It's therefore safe for development, but not for production.

What's much safer, however, is letting the BrowserWindow instances directly access the static files of your renderer. This is made possible by next export, a new sub command that we've introduced with Next.js 3

I'm guessing next export is equivalent to running nuxt in --spa mode. So perhaps similar considerations can be applied to this template

cc @Atinux

alexisohayon

alexisohayon posted a new question

electron-template • 9 months ago

Axios breaks the loading?

Hi,

Nice package! I'm facing an issue that blocks the loading, apparently caused by the axios package (https://github.com/nuxt-community/axios-module).
I get a "Cannot read property 'env' of undefined" error :
capture d ecran 2017-11-17 a 16 23 08

Any idea how to fix this? :) Thanks!

lyric-index

lyric-index posted a new question

electron-template • a year ago

Cannot find module 'nuxt'

This problem occurs when I try to pack.

image

  • OS Version: Windows_NT ia32 10.0.16294
  • Node version: v8.6.0
  • NPM version: 5.4.2

Steps to Reproduce:

npm run package:win
(npm run build && electron-packager ./ nuxt-cli --platform=win32 --arch=x64 --version=1.7.8 --out=./ --overwrite --icon=favicon.ico --ignore=node_modules --prune)

image

alexchopin

alexchopin posted a new question

electron-template • a year ago

nuxtjs with electron `loadURL` is slow
ruslankonev

ruslankonev posted a new question

electron-template • a year ago

Need update code for [email protected] and add NeDB support

Guys, I know, you spend a lot of time for release [email protected], and it's great, but when you have a time, please update this template for actual version. Thanks

greenkeeper[bot]

greenkeeper[bot] posted a new question

electron-template • a year ago

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

Kylart

Kylart posted a new question

electron-template • a year ago

Support for browser ?

I am referring to #3 and #4 . Now I have this

// nuxt.config.js
...
build: {
    extend (config, {isClient}) {
      // Extend only webpack config for client-bundle
      if (isClient)
      {
        config.target = 'electron-renderer'
      }
    },
    vendor: ['vuetify', 'axios']
  },
...

And if I go to the _NUXT_URL_ in my browser, I get the common error that require is not defined and so my app doesn't do that much.
Well, I am not that much of a front-end developper but isn't there any way to get this work in the browser too ?
Maybe browserify or something would do the job ?
The idea would be to have the app working when embed in electron and in the browser.

OR

Would it be possible to access process from store/index.js as it is supposed to be available for both main and renderer process ? (see here)

process seems to be undefined when called in this file.

It might not be possible though.

adrianrey05

adrianrey05 posted a new question

electron-template • a year ago

add plugins

Hi,
how to add plugins in nuxt.config.js?
I am trying to add vuetify this.
like this

module.exports = {
  /*
  ** Electron Settings
  */
  electron: {
    width: 1024,
    height: 768
  },
  build: {
    vendor: ['vuetify'],
    plugins: ['~plugins/vuetify.js'],
    head: {
      link: [
        { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto' },
        { rel: 'stylesheet', href: 'https://fonts.googleapis.com/icon?family=Material+Icons' }
      ]
    },
    extend (config, { isClient }) {
      // Extend only webpack config for client-bundle
      if (isClient) {
        config.target = 'electron-renderer'
      }
    }
  }
}
foundryspatial-duncan

foundryspatial-duncan posted a new question

electron-template • a year ago

sass-loader doesn't work

I'm getting a fatal error when I try to use <style lang="scss">.
On OSX El Capitan 10.11.6, if I install the sass-loader with:

yarn add --dev sass-loader node-sass

…and then try to do yarn run dev, I get the following error:

Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (53)

I'm confused about this error, because scss works just fine with other vue+electron projects like SimulatedGREG/electron-vue. I don't understand why the sass-loader or node-sass would be trying to un under a different environment, regardless of if electron is used. Any idea?

PeterKnight

PeterKnight posted a new question

electron-template • a year ago

How to communicate between main process and renderer processes?

I'm trying to pass on a message from the main process to a vue component, but requiring electron inside a vue component doesn't work (Can't resolve 'fs' in…electron error). Looking at https://github.com/nuxt/electron/issues/3 it seems we can't include most packages, such as electron itself inside a vue component. So how is it done?

Kylart

Kylart posted a new question

electron-template • a year ago

Can't require most packages from client-side

Hi,

I am using this starter to migrate my electron app to Nuxt and so far I really like it.

Yet, I have a problem. Actually I have a solution to it and I understand why it is this way but I'd like to get it working just like any electron page.

Electron allows one to get rid (until a certain point) of client and server-side. But here, it is not possible to require any package needing fs, tls and net (which includes a lot of packages). In a normal website or Nuxt project, this would be completely normal but here it can be problematic and troublesome sometimes isn't it ?

I could not even require('electron-router') in the store or on client-side.

So right now, I have to make routes like this for example:

// main.js
const route = require('./assets/scripts/init/main.js').route(nuxt)
const server = http.createServer(route)
// assets/scripts/init/main/js
const URL = require('url-parse')

const {openExternal} = require('./openExternal.js')
const releases = require('./releases.js')
const seasons = require('./seasons.js')

exports.route = (nuxt) => {
  return (req, res) => {
    const url = new URL(req.url)

    switch (url.pathname)
    {
      case '/openThis':
        openExternal(url, res)
        break

      case '/seasons.json':
        seasons.getSeason(url, res)
        break

      case '/releases.json':
        releases.getLatest(url, res)
        break

      default:
        nuxt.render(req, res)
    }
  }
}

Isn't it possible for client to have access to any module as well just like in a basic electron app where I could just require('fs') anywhere in the app?

I do not intend to criticise anything, just asking 😮