I'm working on a big React + TypeScript project.
It works well on the local machine of other colleagues, but on mine I get the following error:
Line 1: Parsing error: Unexpected token, expected ";"
as you can see below:
Here is the source code:
export type LoadOfferType = typeof import("../offers/defaultOffer");
export const loadOffer = async (): Promise<LoadOfferType> => {
const offerName = process.env.NODE_ENV === "development" ? process.env.REACT_APP_FALLBACK_SITE : "defaultOffer";
/**
* We use a switch statement instead of ane xpression for the offer path
* because Webpack throws a critical dependency error when using paths
* that are not explicitly defined.
*/
switch (offerName) {
case "mysite.com":
return await import("../offers/mysite.com");
default:
return await import("../offers/defaultOffer");
}
};
The commands I ran after cloning the repository were:
$ yarn install
$ yarn start
Here there is some info about my system:
$ node -v
v12.13.0
$ npm -v
6.12.0
$ yarn -v
1.19.1
Any idea on how to fix this?
Thanks!


"../offer/defaultOffer"?export type LoadOfferType = typeof require("../offers/defaultOffer");?"module": "esnext"in your configuration