Closed rahul-webd closed 1 year ago
Any chance you have an example codebase we could look at?
I know with Next.js all of the Session Kit and its plugins need to be exclusively loaded client side (the SSR will throw errors), but that doesn't seem to be related to the error. This sounds like some sort of bundler issue with how the project itself is including the dependencies.
It's just hard to tell exactly what's happening based on the information provided thus far.
You can try out this Repo https://github.com/rahul-webd/next-wharf-demo, There will be a reference error due to Wombat.
Yes, it seems to be some bundler issue. The type: module
field in package.json
is passed down to the output. And since in the ES module type, all .js
files default to the ES module (.mjs
if not explicitly defined), it expects an ES module behaviour there but require
is being used to import some dependency in the conflicting file which shows the CommonJS pattern and hence the conflict occurs.
Awesome, thanks much for the example as well as some clarity on what's happening.
We removed the type: module
from the package and reworked some of our dependencies, and a new release is published as 1.0.4
. Let us know if that works for you!
It is working now. Thanks.
I am getting a reference error while using this library in a Next.js Project with Typescript.
It seems like having
type: module
inpackage.json
creates this error.