diff --git a/packages/babel-config/src/plugins/babel-plugin-redwood-cell.ts b/packages/babel-config/src/plugins/babel-plugin-redwood-cell.ts index 3dbcb8615f3c..9e49020e04bb 100644 --- a/packages/babel-config/src/plugins/babel-plugin-redwood-cell.ts +++ b/packages/babel-config/src/plugins/babel-plugin-redwood-cell.ts @@ -114,6 +114,12 @@ export default function ({ types: t }: { types: typeof types }): PluginObj { } }, Program: { + enter() { + // Reset variables as they're still in scope from the previous file + // babel transformed in the same process + exportNames = [] + hasDefaultExport = false + }, exit(path) { const hasQueryOrDataExport = exportNames.includes('QUERY') || exportNames.includes('DATA')