I recently upgraded to the latest version of Elder.js and started getting this error when trying to build:
SyntaxError: Unexpected token l in JSON at position 2
After poking around for quite a bit, I was able to fix this by putting quotes around the keys in the hydrate-options attribute for components.
Is this a breaking change? If so, I didn't see it called out in any of the docs/release notes. Happy to put in a PR to update the docs as well but wanted to make sure I'm understanding the issue and fix properly first, and there isn't something I'm missing.
I recently upgraded to the latest version of Elder.js and started getting this error when trying to build:
SyntaxError: Unexpected token l in JSON at position 2
After poking around for quite a bit, I was able to fix this by putting quotes around the keys in the
hydrate-options
attribute for components.Before:
<ScrollToTop hydrate-client={{}} hydrate-options={{ loading: "eager" }} />
After
<ScrollToTop hydrate-client={{}} hydrate-options={{ "loading": "eager" }} />
The first method matches what's currently in the docs but no longer seems to work. I was able to dig around for the fix by looking in https://github.com/Elderjs/elderjs/blob/e8435c2444698602dbd6e9bf945e7d17db38f862/src/partialHydration/__tests__/partialHydration.spec.ts
Is this a breaking change? If so, I didn't see it called out in any of the docs/release notes. Happy to put in a PR to update the docs as well but wanted to make sure I'm understanding the issue and fix properly first, and there isn't something I'm missing.