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

fix: skip serializing functions returned by exported functions during pause #4901

Closed
wants to merge 1 commit into from

Conversation

nynevi
Copy link
Contributor

@nynevi nynevi commented Aug 1, 2023

Overview:

Prevents serializing functions that return other functions which otherwise yields in error Only primitive and object literals can be serialized:

Fixes #4371

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

@stackblitz
Copy link

stackblitz bot commented Aug 1, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Aug 1, 2023

👷 Deploy request for qwik-insights pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4fb9752

@zanettin zanettin added the WAITING FOR: team Waiting for one of the core team members to review and reply label Aug 18, 2023
Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution; unfortunately, I don't think this is the correct fix.

  1. This fix silently ignores function values during serialization and deserializes them as undefined This will cause a surprise in the browser. The correct behavior is to tell the developer that they have made a mistake.
  • There should be a clear runtime error (instead of the current cryptic error)
  • The linter should be updated to underline the offending code correctly.
  1. We need to have tests with the change.

@mhevery mhevery added WAITING FOR: user Further information is requested from the issue / pr opener and removed WAITING FOR: team Waiting for one of the core team members to review and reply labels Aug 23, 2023
@gioboa
Copy link
Member

gioboa commented Apr 17, 2024

@nynevi thanks for opening this PR.
I'm closing this for now because it's stale, feel free to create a new PR with your improvements. 💪

@gioboa gioboa closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP: runtime WAITING FOR: user Further information is requested from the issue / pr opener
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐞] strange behaviour: Code(3): Only primitive and object literals can be serialized
4 participants