solidjs-community / solid-primitives

A library of high-quality primitives that extend SolidJS reactivity.
https://primitives.solidjs.community
MIT License
1.27k stars 126 forks source link

[i18n] SSR #307

Closed krulod closed 1 year ago

krulod commented 1 year ago

What is the best way to use @solid-primitives/i18n with SolidStart? Right now, it throws an error during server-side rendering:

ReferenceError: navigator is not defined
thetarnav commented 1 year ago

Thanks for the issue The only navigator call I see is here and it is in the default param value. https://github.com/solidjs-community/solid-primitives/blob/main/packages/i18n/src/index.ts#L67 So right now to avoid it you probably should pass a lang param to not run it. The package needs to be updated to not include browser APIs on the server though.