SolidJSS
SolidJS13mo ago
11 replies
blazekids

SolidStart: serialization error when there is a default value in `createSignal`

Hello, I am trying to learn solid with the async resource tutorial: https://www.solidjs.com/tutorial/async_resources but with an api route in the app. The api route is just a simple GET with the same thing.

I created https://github.com/mingchia-andy-liu/solidjs-test as MVP. Whenever there is a default value in my component. npm run dev will throw an error.
    cause: j [Error]: Seroval caught an error during the parsing process.
    Error
    The value [object Function] of type "function" cannot be parsed/serialized.


However, if I start dev mode without a default value, then edit the file after. The hot module reload would successfully compile the component.

Problematic line: https://github.com/mingchia-andy-liu/solidjs-test/blob/b73e90ae7429380b9dbc03b0c7aabd792094a115/src/routes/index.js#L17

I am not sure what could be causing this issue. Preset is cloudflare module as I want to deploy this in cloudflare. I am not sure if this changes anything.
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
SolidJS
GitHub
Contribute to mingchia-andy-liu/solidjs-test development by creating an account on GitHub.
GitHub - mingchia-andy-liu/solidjs-test
GitHub
Contribute to mingchia-andy-liu/solidjs-test development by creating an account on GitHub.
solidjs-test/src/routes/index.js at b73e90ae7429380b9dbc03b0c7aabd7...
Was this page helpful?