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?]: Error: Cannot serialize function without reference ID. #1142

Closed
2 tasks done
MarByteBeep opened this issue Dec 15, 2023 · 1 comment
Closed
2 tasks done

[Bug?]: Error: Cannot serialize function without reference ID. #1142

MarByteBeep opened this issue Dec 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MarByteBeep
Copy link

MarByteBeep commented Dec 15, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

very simple createRouteData example below will cause some infinite loop and a number of errors reported on server:

import { createRouteData } from 'solid-start';

async function sleep(ms: number) {
	return new Promise((resolve) => setTimeout(resolve, ms));
}

export default function Test() {
	const data = createRouteData(async () => {
		// comment line below, and all works fine 
		const response = await fetch('/api/test');

		await sleep(2000);
		return 'Test';
	});

	return <div>{data()}</div>;
}

It seems to choke on relative URLs, http://localhost/api/test works fine, /api/test does not.

Another thing I observed is that page doesn't immediately show, it waits for 2 seconds.

Expected behavior 🤔

Waiting for an async fetch to finish shouldn't cause some infinite loop
Also the page should not wait 2 seconds before displaying anything.

Steps to reproduce 🕹

Steps:

  1. Make component Test with above example
  2. Run it

Context 🔦

No response

Your environment 🌎

"solid-start-node": "^0.3.10",
"typescript": "^4.9.5",
"vite": "^4.4.9"
"@solid-primitives/keyboard": "^1.2.5",
"@solidjs/meta": "^0.29.1",
"solid-js": "^1.8.7",
"solid-start": "^0.3.10",
"node": "18"
@MarByteBeep MarByteBeep added the bug Something isn't working label Dec 15, 2023
@ryansolid
Copy link
Member

In setting up for SolidStart's next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed by mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience.

See #1139 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants