Closed ghost closed 1 year ago
This is most likely due to @concordium/web-sdk
using browser only functionality, and nextJS does server side rendering of client-side apps.
Long story short, you should be able to resolve this by resolving @concordium/web-sdk
as @concordium/node-sdk
in the webpack config section of your next.config.js
(see their docs).
The configuration would be something like:
if (isServer) {
webpack.resolve.alias['@concordium/web-sdk'] = '@concordium/node-sdk';
}
We have plans to make the @concordium/web-sdk
package compatible with server-side rendering, though it's not certain when this will be available. For now the workaround described above should help.
A side note, this should have nothing to do with the browser wallet repository though. But as I wrote in my previous comment, we are aware of the inconvenience of having to do this workaround, so if the workaround works there is no need to create an issue for this.
For reference, here is the issue: https://github.com/Concordium/concordium-node-sdk-js/issues/112
Nothing to do with the wallet.
Bug Description
I have an react application in which I've implemented concordium sdk it was working well but when I have started migrating it to nextjs it is not working and it throws a error called Syntax Error: Unexpected token 'export' for concordium/browser-wallet-api-helpers package and can't resolve '@concordium/web-sdk' for @concordium/web-sdk package