Skip to content

serverFunctionUrl returns /_server/<id>, but the server function invocation actually fetches /_server/data/<id>, making serverFunctionUrl return value unusable for preloading #3440

Description

@NawfelBgh

Describe the bug

serverFunctionUrl returns /_server/<id>, but the server function invocation actually fetches /_server/data/<id>, making serverFunctionUrl return value unusable for preloading

I reproduced the bug in the file App.tsx from the repo reproduce-serverFunctionUrl-bug

The rendered result is:

serverFunctionUrl(getData.id): /_server/getData-8830d325
actual fetch url: http://localhost:4174/_server/data/getData-8830d325
serverFunctionUrl does NOT match the URL the server function actually uses!

Your Example Website or App

https://github.com/NawfelBgh/reproduce-serverFunctionUrl-bug

Steps to Reproduce the Bug or Issue

Build the run the provided app
Visit the home page

Expected behavior

The current behavior with the bug is that the app renders:

serverFunctionUrl(getData.id): /_server/getData-8830d325
actual fetch url: http://localhost:4174/_server/data/getData-8830d325
serverFunctionUrl does NOT match the URL the server function actually uses!

After correction, it should render:

...
URLs match.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Firefox
  • Version: "solid-js": "2.0.0-rc.8"

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions