Closed sergiomensing closed 1 year ago
@sergiomensing Thank you for reporting this issue. For testing reasons, which nextjs version are you using (I understand this is reproducible with the example version, but we could test with both)?
Hi @beetlerom, we are currently using version 13.0.6
of nextjs.
we are seeing the same issue with 13.1.1
We are able to work around by using following next.config.js `/* @type {import('next').NextConfig} / const path = require('path')
const nextConfig = { reactStrictMode: true, swcMinify: false, compiler: { removeConsole: false, styledComponents: true, }, transpilePackages: ['@bloomreach/spa-sdk'], }
module.exports = nextConfig`
We have also upgraded node to 16.16.0 and npm to 8.11.0
It seems like updating to node 16 fixes the issue, but it's not clear why, we will investigate further.
We would have to check the build output for the relevance module. I'm guessing its only in esm and not cjs and therefore next.js fails compiling it on the server side (although its fine for the main app I guess?). Will have to look into it further.
FYI, we are using node 18
@joerideg, do you maybe have an update for us on this issue?
Created https://issues.onehippo.com/browse/SPASDK-163 for progress tracking
Hi @sergiomensing we're gonna look into it, its likely just a matter of tweaking the build output such that it also outputs a commonjs bundle
Hi @sergiomensing , We just released 21.0.0, adding a CJS bundle of the express module. This should resolve your problem! I've tried it with a newly generated Next.js 13 app and it seems to build (and render) just fine now 👍🏻
We are trying to upgrade the SDK in our frontend project (next) to
18.0.1
but there seems to be an error where Next expects another JS format then ESM. But for relevance the only file in the package code is the ESM version.So when we try to import the relevance function, this results in the following error:
When trying the provided nextjs example by this Bloomreach SDK it also produces this error.