Giter Site home page Giter Site logo

Comments (5)

vishalbalaji avatar vishalbalaji commented on May 25, 2024 4

I know that this is an old issue, but I was also searching for such a solution and I came upon this.

I made a minimal configuration based on this repo, but with adapter-node. Basically, the built node app is bundled with the application and is started before the window is created. Instead of loading built static files, the electron app loads a URL. This is only a workaround and one caveat of it is that it starts the node app on localhost, which is also accessible through your browser, rather than being scoped to the Electron app. This is the behaviour I was hoping to achieve, but the same may not apply for you.

You can check it out here.

from electron-sveltekit.

Dax89 avatar Dax89 commented on May 25, 2024

SvelteKit now asks to execute npm run preview command which was missing in package.json, I have added it and now looks fine on my side.

Let me know if it works!

from electron-sveltekit.

mattpilott avatar mattpilott commented on May 25, 2024

Thanks for that Dax seem to have same/similar issue. Here's what i'm seeing:
Screenshot 2021-11-09 at 3 20 37 pm

Here's my package.json

{
  "name": "matter",
  "version": "0.0.1",
  "main": "src/electron.cjs",
  "scripts": {
    "dev": "svelte-kit dev",
    "build": "svelte-kit build",
    "preview": "svelte-kit preview",
    "start": "svelte-kit start",
    "electron": "concurrently --kill-others \"svelte-kit dev\" \"electron src/electron.cjs\"",
    "dev:package": "npm run build && electron-builder --config electron-builder.config.json --dir",
    "package": "npm run build && electron-builder --config electron-builder.config.json"
  },
  "dependencies": {
    "@neuekit/utils": "^2.0.0-alpha.16",
    "electron-serve": "^1.1.0",
    "electron-window-state": "^5.0.3"
  },
  "devDependencies": {
    "@neuekit/reboot": "^1.10.2",
    "@sveltejs/adapter-node": "^1.0.0-next.55",
    "@sveltejs/kit": "next",
    "concurrently": "^6.3.0",
    "electron": "^15.3.1",
    "electron-builder": "^22.13.1",
    "electron-reloader": "^1.2.1",
    "sass": "^1.43.4",
    "svelte": "^3.42.6",
    "svelte-preprocess": "^4.9.8",
    "twitter-api-v2": "^1.6.5"
  },
  "type": "module"
}

from electron-sveltekit.

Dax89 avatar Dax89 commented on May 25, 2024

Did you have tried without custom packages? Just to make sure that electron and svelte works without issues

from electron-sveltekit.

mattpilott avatar mattpilott commented on May 25, 2024

Ok fixed that issue but adapter-node does not work when you use npm run dev:package or npm run package even tried on this repo without any changes (apart from swapping the adapter in svelte config of course)

from electron-sveltekit.

Related Issues (7)

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.