Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter Node #17

Open
ghost opened this issue Feb 1, 2022 · 22 comments
Open

Adapter Node #17

ghost opened this issue Feb 1, 2022 · 22 comments

Comments

@ghost
Copy link

ghost commented Feb 1, 2022

Is there a way to use @sveltejs/adapter-node ?
It seems to works for dev but as soon as i build the app i only get a blank window.

@braebo
Copy link
Owner

braebo commented Feb 6, 2022

Hey- I haven't tried this yet. Did you manage to get it working?

@itssumitrai
Copy link

I have the same issue, the resulting app is empty. Is this project still in development ?

@ghostdevv
Copy link
Collaborator

Yep! PRs are welcome, wasn't able to get this working in my brief testing before @itssumitrai

@JBloss1517
Copy link

I'm also running into this problem. Has anyone found a solution to this yet?

@ghostdevv
Copy link
Collaborator

There are solutions but they aren't worth the trouble IMO - what is your use case? @JBloss1517

@JBloss1517
Copy link

I was hoping to use the Sveltekit load function (or the new page endpoints) to get my data ahead of the page rendering, and was thinking that was going to require adapter-node to make work.

@ghostdevv
Copy link
Collaborator

You should still be able to use a load function iirc - I will take a look tomorrow if there is a way we can make it more easy to expose the node adapter

@JBloss1517
Copy link

Awesome! Thank you

@ghostdevv
Copy link
Collaborator

Hey, I started to take a look and have a few ideas - I am away till friday so will finish up saturday!

@JBloss1517
Copy link

That's so awesome of you, thank you!

@LukeHagar
Copy link

Hey just wanted to check in on this? I have a use case for the node adapter especially with recent sveltekit updates

@ghostdevv
Copy link
Collaborator

I started work on an adapter and forgot to finish it! let me see if I can get any further with it this week - and will put what I got online regardless

@ogrotten
Copy link

ogrotten commented Oct 7, 2022

Was there a result/solution for this?

@inday-jin
Copy link

inday-jin commented Jan 19, 2023

Hey, How use +server.js?
this not working

@navsubrm
Copy link

I tried working on this, but it wouldn't let me install adapter-node. Instead, I just created a sample SvelteKit project using adapter-node and published it. If anyone wants to use it, the link is: https://github.com/navsubrm/svelte-electron-node-adapter/blob/master/index.cjs.

I haven't tested the build on windows, but it builds and runs fine on Mac. It should work with any imported SvelteKit app.

@Nate561
Copy link

Nate561 commented Apr 20, 2023

@ghostdevv, did you ever push the changes you made? I am curious how you solved using the node adapter.

@JohnRSim
Copy link

Works in win10 ;)

@ibilux
Copy link

ibilux commented May 30, 2023

any updates ?

@JohnRSim
Copy link

I tried working on this, but it wouldn't let me install adapter-node. Instead, I just created a sample SvelteKit project using adapter-node and published it. If anyone wants to use it, the link is: https://github.com/navsubrm/svelte-electron-node-adapter/blob/master/index.cjs.

I haven't tested the build on windows, but it builds and runs fine on Mac. It should work with any imported SvelteKit app.

@ibilux I'm using this and building packaging for Mac/Windows and it's working for me - electron/sveltekit with nodejs(sveltekit).

A few issues I had during working with it..
I have to run npm run dev:svelte/electron separately.

On build I have to make sure that sveltekit is not part of the app.asar

  • couldn't seem to get it to work if it was packaged etc..

@ibilux
Copy link

ibilux commented May 30, 2023

I haven't tested the build on windows, but it builds and runs fine on Mac. It should work with any imported SvelteKit app.

I'm trying to use it right now. It's a clever idea. I'll work with it I may can do something with the packaging.

@JohnRSim
Copy link

If you can figure out the packaging let me know - I wasted a day trying different things to get it to work - and ended up just leaving the build dir unpackaged wiith the config - using nsis for the package manager


		"files": [
			"app/**/*",
			"build/**/*",
			"index.cjs",
			"package.json",
			"preload.cjs"
		],
		"asarUnpack": [
			"build/**/*",
			"node_modules/**/*"
		]

@JohnRSim
Copy link

JohnRSim commented Jun 1, 2023

Also forgot to mention I'm using electron-builder for packaging -

npx electron-builder build --windows
npx electron-builder build --mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests