{"record":{"id":"08d7ec80548d2a73","repo":"gatsbyjs/gatsby","slug":"this-plugin-file-is-using-both-commonjs-and-es6-mo-08d7ec","errorCode":null,"errorMessage":"This plugin file is using both CommonJS and ES6 module systems together which we don't support.\nYou'll need to edit the file to use just one or the other.\n\nplugin: ${modulePath}.js\n\nThis didn't cause a problem in Gatsby v1 so you might want to review the migration doc for this:\nhttps://gatsby.dev/no-mixed-modules\n      ","messagePattern":"This plugin file is using both CommonJS and ES6 module systems together which we don't support\\.\nYou'll need to edit the file to use just one or the other\\.\n\nplugin: (.+?)\\.js\n\nThis didn't cause a problem in Gatsby v1 so you might want to review the migration doc for this:\nhttps://gatsby\\.dev/no-mixed-modules\n      ","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/bootstrap/resolve-module-exports.ts","lineNumber":167,"sourceCode":"      // get foo from `module.exports.foo = bar`\n      if (t.isMemberExpression(nodeLeft.object)) {\n        const exp: t.MemberExpression = nodeLeft.object\n\n        if (\n          t.isIdentifier(exp.object) &&\n          t.isIdentifier(exp.property) &&\n          exp.object.name === `module` &&\n          exp.property.name === `exports`\n        ) {\n          isCommonJS = true\n          exportNames.push((nodeLeft.property as t.Identifier).name)\n        }\n      }\n    },\n  })\n\n  if (isES6 && isCommonJS && process.env.NODE_ENV !== `test`) {\n    report.panic(\n      `This plugin file is using both CommonJS and ES6 module systems together which we don't support.\nYou'll need to edit the file to use just one or the other.\n\nplugin: ${modulePath}.js\n\nThis didn't cause a problem in Gatsby v1 so you might want to review the migration doc for this:\nhttps://gatsby.dev/no-mixed-modules\n      `\n    )\n  }\n  return exportNames\n}\n\ninterface IResolveModuleExportsOptions {\n  mode?: `analysis` | `import`\n  resolver?: ModuleResolver\n  rootDir?: string\n}","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/bootstrap/resolve-module-exports.ts#L149-L185","documentation":"Error \"This plugin file is using both CommonJS and ES6 module systems together which we don't support.\nYou'll need to edit the file to use just one or the other.\n\nplugin: ${modulePath}.js\n\nThis didn't cause a problem in Gatsby v1 so you might want to review the migration doc for this:\nhttps://gatsby.dev/no-mixed-modules\n      \" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby/src/bootstrap/resolve-module-exports.ts:167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the plugin file to use only ES modules (import/export) or only CommonJS (module.exports/require)","See https://gatsby.dev/no-mixed-modules for the v1 to v2 migration notes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}