CTA v7.26.0 is giving "fetch is not a function" error

I have a boilerplate create t3 app@latest and installed 1 package the monday-sdk-js package.

It works fine with cta@7.22.0 (nextjs 13) but is throwing an error on cta@7.26.0 (next14). Next13 has to have the experimental server action flag and next14 does not. Same code on both boilerplates but on next14 I am now getting error:

node_modules\.pnpm\monday-sdk-js@0.5.3\node_modules\monday-sdk-js\src\monday-api-client\fetch.js (5:9) @ fetch
 ⨯ TypeError: fetch is not a function


Any idea why this is happening?
Solution
@cje

Found the answer. I had to modify next.config:

await import("./src/env.mjs");

/** @type {import("next").NextConfig} */
const config = {
  experimental: {
    serverComponentsExternalPackages: ["monday-sdk-js"],
  },
};

export default config;
Was this page helpful?