I am getting this error "ReferenceError: exports is not defined in ES module scope" while deploying my backend to render
I just have two typescript files which when compiled creates two .js files automatically.
This is how I am importing and exporting things between my two typescript files
import axios from "axios";
`import * as cron from "node-cron";
import { BASE_URL, Expenses } from "./recurring-logic.js";
export interface ProfileData {
maxXp: number;
xp: number;
title: string;
level: number;
}
My package.json contains this line
"type": "module",`
The image shows the files in my directory.
What am I doing wrong here and What should I do to get it deployed ?
I tried converting my imports from
"import cron from "node-cron";
this to
"import * as cron from "node-cron";
this as said by chatGPT but didn't work out. It still shows the same error.