/my-app/dist/graphql/resolvers/Mutations/site.js:7
const netlify_1 = __importDefault(require("netlify"));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /my-app/node_modules/netlify/src/index.js from /my-app/dist/graphql/resolvers/Mutations/site.js not supported.
Instead change the require of index.js in /my-app/dist/graphql/resolvers/Mutations/site.js to a dynamic import() which is available in all CommonJS modules.
Apologies for the delay here! Can you please share a link to your site as well as your most recent deploy log?
Additionally, have you seen this thread? It looks like the very last exchange in the post was from a Forums member with a similar error (Error [ERR_REQUIRE_ESM]: require() of ES Module):
I filed an issue on the GitHub repo for netlify js client and they said it’s expected. The client api only exports esm not common js. The proposed solution is to use “module: ‘nodenext’”, but doing that breaks a bunch of other imports and it also isn’t a stable release yet. Alternatively it was suggested to use a dynamic import, but I got the same error when doing that.
So I gave up and wrote my own.
Not sure why the js client wouldn’t be compatible in ts environments, but it appears to not be.