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

Server Function Runtime Config: Nitro support Bun.js #1040

Open
TLevesque opened this issue Jan 28, 2025 · 0 comments
Open

Server Function Runtime Config: Nitro support Bun.js #1040

TLevesque opened this issue Jan 28, 2025 · 0 comments
Assignees
Labels
pending review Awaiting review by team members.

Comments

@TLevesque
Copy link

📚 Subject area/topic

/solid-start/reference/config/define-config.mdx

📋 Page(s) affected (or suggested, for new content)

https://docs.solidjs.com/solid-start/reference/config/define-config
Image

📋 Description of content that is out-of-date or incorrect

Hi,

On this page https://docs.solidjs.com/solid-start/reference/config/define-config of the solidstart documentation, we can see how to setup an alternative server runtime instead of Node.js , like Deno, because it is supported by Nitro (if I do understand well ?), by looking at the Nitro's documentation, I can see that it also support Bun.js as a runtime (https://nitro.build/deploy/runtimes/bun), with the preset "bun". After having a look to the SolidStart's code, if I'm not mistaking, I do not see specific configuration to enable the preset "deno_server", so I guess that with the "bun" preset, it should work too, with very little effort, like:

// app.config.js file 
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
  server: {
    preset: "bun",
  },
});

Even if I tried with the basic project example bellow of a page with a button which call a server function to create a local file with Bun.js method Bun.write("./newfile.txt", "Hello Bun.js"); , and it did not worked (Error: "Bun is not defined"), maybe I missing something within the config of project.

I'm sharing the repo bellow:

Thanks a lot for your feedback.
And if you can help me out to make this configuration work, I'll make PR to complete SolidStart's repo examples with great Bunjs' features within SolidStart.

Best

Image

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

Here the basic repo to try it out: https://github.com/TLevesque/solidstart-bunjs/tree/main

@TLevesque TLevesque added the pending review Awaiting review by team members. label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending review Awaiting review by team members.
Projects
None yet
Development

No branches or pull requests

2 participants