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

[Bug?]: Crashes with TypeError: Cannot read properties of null (reading 'createServerReference') #1223

Closed
2 tasks done
bartoszkrawczyk2 opened this issue Jan 5, 2024 · 5 comments
Labels
bug Something isn't working needs reproduction issue needs a reproduction vinxi related to vinxi

Comments

@bartoszkrawczyk2
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Once in a while dev server crashes with an error:

TypeError: Cannot read properties of null (reading 'createServerReference')

After making some changes and hot reload it disappears.

Expected behavior 🤔

No response

Steps to reproduce 🕹

Steps:

  1. Create init project
  2. Add server cache in Home:
const getHello = cache(() => {
  "use server";
  return { message: 'hello; };
}, "hello");

export const route = {
  load: () => getHello(),
};

export default function Home() {
  const hello = createAsync(getHello);
  // ...
  1. Do some changes in Home component
  2. Sometimes it crashes, sometimes it resumes. Hard to recreate exact steps, it seems random (I suspect some kind of race condition).

Context 🔦

No response

Your environment 🌎

System:
    macOS 13.0     M2 Mac

Node:
   node v20.10.0
   npm  v10.2.3
@bartoszkrawczyk2 bartoszkrawczyk2 added the bug Something isn't working label Jan 5, 2024
@ryansolid ryansolid added the vinxi related to vinxi label Jan 5, 2024
@exectx
Copy link

exectx commented Feb 8, 2024

It crashes for server functions. if you remove the load function, first load doesn't get any errors but if you navigate back, it gets the null error. The error shows in local production build and dev

  "dependencies": {
    "@solidjs/meta": "^0.29.2",
    "@solidjs/router": "^0.11.5",
    "@solidjs/start": "^0.5.3",
    "solid-js": "^1.8.14",
    "vinxi": "^0.2.1"
  },

@ryansolid
Copy link
Member

I am having no luck reproducing this. I know it is supposed to be hard to reproduce, but I understand the original issue is related to dev environment. I'm just not seeing this no matter what I do.

@senabi are you saying you see this message a different way. Most specifically around createServerReference? Cannot read properties of null in general can happen for a variety of reasons but I'm interested around createServerReference.

@ryansolid ryansolid added the needs reproduction issue needs a reproduction label Feb 12, 2024
@exectx
Copy link

exectx commented Feb 15, 2024

@ryansolid sorry for the late response. The exact error I got is Cannot read properties of null (reading 'startsWith') using. the basic template. But it seems it's been partially solved by #1328 .

@gabrielmfern
Copy link
Contributor

gabrielmfern commented Feb 17, 2024

@ryansolid sorry for the late response. The exact error I got is Cannot read properties of null (reading 'startsWith') using. the basic template. But it seems it's been partially solved by #1328 .

I think this was fixed, I also had this. This was fixed by #1329. It's been out since 0.5.6

@nksaraf
Copy link
Member

nksaraf commented Mar 2, 2024

Seems like this is fixed. if it's still an issue, reopen this issue. Try with latest solid-start and vinxi.

@nksaraf nksaraf closed this as completed Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction issue needs a reproduction vinxi related to vinxi
Projects
None yet
Development

No branches or pull requests

5 participants