change the require of main.js in /.../req.cjs to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/.../req.cjs:1:13) { code: 'ERR_REQUIRE_ESM' } ほならdynamic import()に変えるか・・・ 事象の振り返り 6
nodenext ) では依然として型エラー error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("graphql-request")' call instead. To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. 1 import { GraphQLClient, ClientError } from "graphql-request"; ~~~~~~~~~~~~~~~~~ TypeScript側の対応 12