You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just discovered your library and I really think It worth to try it :)
I'm facing issue with Next.js compatibility. So I quickly tried with a CRA, it does work without any problem
importlogofrom'./logo.svg';import'./App.css';import{Orion}from"@tailflow/laravel-orion/lib/orion";Orion.init('https://your-api.test');Orion.setToken('access-token-here');functionApp(){console.debug(Orion.getToken())// Will output 'access-token-here' as expectedreturn(<divclassName="App">[...]</div>);}exportdefaultApp;
With a Next.js, I got the error SyntaxError: Cannot use import statement outside a module.
Thank you for raising this issue. Indeed, SSR is something I have totally missed! The goal of this SDK is to provide a complete solution for consuming Orion-powered REST APIs, whether it be from a client, or a server side.
That being said, I will look into providing support for SSR in the next releases ✨
alexzarbn
changed the title
[Compat] Compatibility with Next.js?
SSR support
Apr 19, 2021
Hi,
I've just discovered your library and I really think It worth to try it :)
I'm facing issue with Next.js compatibility. So I quickly tried with a CRA, it does work without any problem
With a Next.js, I got the error
SyntaxError: Cannot use import statement outside a module
.Some related issues:
Digging deeper, I found this: https://stackoverflow.com/questions/62422174/cannot-use-import-statement-outside-a-module-with-next-js (answer: https://stackoverflow.com/a/62423865/2098861) ;
Related issue, if I understand it correctly:
Could you take a look and make your library compatible both server&client side (if it's not really the case)?
In the meantime, I'm trying the "dynamic" imports or "useEffect" with import inside (found in related issues linked above).
I don't know how to help more, but ask if you need more details / help / reproducible example...
Thanks,
Regards.
Edit: looking further, it seems that the problem is more on next.js side than on libraries...
The text was updated successfully, but these errors were encountered: