Skip to content

fix: server functions inclusivity + runtime exports#2127

Open
lxsmnsyc wants to merge 6 commits intomainfrom
feat-directives-subpath
Open

fix: server functions inclusivity + runtime exports#2127
lxsmnsyc wants to merge 6 commits intomainfrom
feat-directives-subpath

Conversation

@lxsmnsyc
Copy link
Copy Markdown
Member

@lxsmnsyc lxsmnsyc commented Apr 4, 2026

  • Fix server functions to allow configurable file filters. I neglected to add this on the original PR.
  • Fix runtime to be exported package rather than accessing it directly by file. Resolution-related issues so this is much better and direct to the point

I've also moved and renamed server fn files since the current ones are too confusing

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 4, 2026

⚠️ No Changeset found

Latest commit: 8e77822

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 4, 2026

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit 8e77822
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/69d13e67ab5ff40008879a5d
😎 Deploy Preview https://deploy-preview-2127--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2127
npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2127

commit: 8e77822

export function cloneServerReference<T extends any[], R>({ id, fn }: Registration<T, R>) {
if (typeof fn !== "function")
throw new Error("Export from a 'use server' module must be a function");
let baseURL = import.meta.env.BASE_URL ?? "/";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running this branch in dev (with vite 8) I now get the following error 🙈:

TypeError: Cannot read properties of undefined (reading 'BASE_URL') at query (file:///...node_modules/.pnpm/...@solidjs/start/dist/fns/server.js:12:35)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katywings got that initially too, but I tried running again and it worked. Did you also try clearing node_modules?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a full clear and multiple restarts of the dev server, the error occurs every time 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be some duplicated code being run here yet again. A top level console.log in registrations is executed twice during server init. I do only have one @solidjs/start in node_modules though... Not sure yet where the second instance is coming from - but I do have some idea, let me check...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah no... If I had to guess my thesis is that this has something to do with the whole server functions preload shenanigans, if the preload means that the code doesn't go through vite's loading behavior that might by the reason for duplicate instances and also for missing import.meta.env. Unfortunately I do not really have the time right now to dig deeper 😅

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

Successfully merging this pull request may close these issues.

2 participants