Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.

Home Page:https://elderguide.com/tech/elderjs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1.6.5 Unexpected token l in JSON at position 2

timeshift92 opened this issue · comments

I Have bug, after update elderjs version from 1.6.3 to 1.6.5

stack: 'SyntaxError: Unexpected token l in JSON at position 2\n at JSON.parse ()\n at Object.inlinePreprocessedSvelteComponent (C:\PROJECTS\Uztelecom\uztelecom\node_modules\@Elderjs\elderjs\build\partialHydration\inlineSvelteComponent.js:18:89)\n at createReplacementString (C:\PROJECTS\Uztelecom\uztelecom\node_modules\@Elderjs\elderjs\build\partialHydration\partialHydration.js:15:36)\n at C:\PROJECTS\Uztelecom\uztelecom\node_modules\@Elderjs\elderjs\build\partialHydration\partialHydr…derjs\elderjs\build\partialHydration\partialHydration.js:22:28)\n at markup (C:\PROJECTS\Uztelecom\uztelecom\node_modules\@Elderjs\elderjs\build\partialHydration\partialHydration.js:40:32)\n at process_markup (C:\PROJECTS\Uztelecom\uztelecom\node_modules\svelte\compiler.js:31608:30)\n at Object.preprocess (C:\PROJECTS\Uztelecom\uztelecom\node_modules\svelte\compiler.js:31638:37)\n at async C:\PROJECTS\Uztelecom\uztelecom\node_modules\@Elderjs\elderjs\build\rollup\rollupPlugin.js:109:31'

I had the same error when I tried to upgrade to the latest version:
Elder.js error in transform. SyntaxError: Unexpected token l in JSON at position 2

Downgraded to version 1.4.0

I believe this is the same issue I had in #226.

Basically, if you're including a Svelte component with hydrate-options you probably need to wrap the keys in quotes. If that fixes it for you, let me know and I'll PR a change to the docs - I had first been waiting for either confirmation from @nickreese that that's the right fix or confirmation from someone else that they had the same issue and can fix it the same way I did. :-)