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: beforeHydrateFn and afterHydrateFn are containing functions result instead of function references #5884

Closed
3 tasks done
tweis opened this issue Jul 4, 2024 · 0 comments · Fixed by #5890 · May be fixed by AnirudhJalagam/ionic-frameworkss#2
Closed
3 tasks done
Assignees
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@tweis
Copy link
Contributor

tweis commented Jul 4, 2024

Prerequisites

Stencil Version

4.19.2

Current Behavior

The expectation for the values of beforeHydrateFn and afterHydrateFn would be that they contain references to functions or noop. However, the variables currently contain the result of the function if beforeHydrate/afterHydrate have been defined in the options. As a result, a TypeError occurs.

Expected Behavior

The variables beforeHydrateFn and afterHydrateFn always contain a reference to a function.

System Info

System: node 18.18.2
    Platform: darwin (23.5.0)
   CPU Model: Apple M2 Pro (12 cpus)
    Compiler: /node_modules/@stencil/core/compiler/stencil.js
       Build: 1719938890
     Stencil: 4.19.2 🏉
  TypeScript: 5.4.5
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.31.1

Steps to Reproduce

  • Clone the repository
  • Install node dependencies
  • Run build npm run build
  • Run node dist/ssr-server/index.js
  • Run curl -d '{"body": "<html><body></body></html>", "url": "http://localhost:3000/", "labels": [], "settings": []}' -H "Content-Type: application/x-www-form-urlencoded" -X POST http://localhost in second terminal session

Code Reproduction URL

https://github.com/tweis/stencil-hydration-typeerror-demo

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
2 participants