-
-
Notifications
You must be signed in to change notification settings - Fork 207
Closed
Description
I am having trouble upgrading a package that recently switched a dependency from long@^4 to long@^5:
node_modules/long/umd/index.d.ts:1:18 - 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("../index.js")' call instead.
1 import Long from "../index.js";
Found 1 error(s).
I can suppress the error by skipping library checks in my tsconfig.json file but perhaps this points to a problem with UMD?
Here is my complete tsconfig for reference (with skipLibCheck=false):
{
"compilerOptions": {
"module": "CommonJS",
"resolveJsonModule": true,
"declaration": false,
"declarationMap": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"outDir": "./dist",
"baseUrl": "./",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": false,
"noEmit": false,
"strictNullChecks": true,
"noImplicitAny": true,
"strictBindCallApply": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"allowJs": true,
"strict": false,
"types": ["mocha", "chai", "node"]
},
"include": ["src/**/*", "hardhat.config.cjs"]
}
GauBen, kirillgroshkov, jpenna, henrik-d, Chaoyingz and 17 more
Metadata
Metadata
Assignees
Labels
No labels