When I run npm run build
or npm run deploy
I got the following errors:
...
../../node_modules/discord.js/typings/index.d.ts:1211:9 - error TS1005: ')' expected.
1211 name: string,
~
../../node_modules/discord.js/typings/index.d.ts:1211:11 - error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
1211 name: string,
~~~~~~
../../node_modules/discord.js/typings/index.d.ts:1212:13 - error TS1005: ';' expected.
1212 required: true,
~
../../node_modules/discord.js/typings/index.d.ts:1213:18 - error TS1109: Expression expected.
1213 channelTypes?: readonly Type[],
~
...
The tsconfig is:
{
"compilerOptions": {
/* Language and Environment */
"target": "es2016",
/* Modules */
"module": "CommonJS",
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node",
"allowJs": true,
"outDir": "lib",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
/* Type Checking */
"strict": true,
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@models/*": ["models/*"],
"@controllers/*": ["controllers/*"],
"@middlewares/*": ["middlewares/*"]
}
}
}
package.json:
{
"name": "@packages/functions",
"version": "1.0.0",
"type": "commonjs",
"scripts": {
"build": "npx tsc",
"build:watch": "tsc --watch",
"serve": "npm run build && firebase emulators:start --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "^12.1.0",
"firebase-functions": "^5.0.0",
"shuffle-seed": "^1.1.6",
"@formkit/tempo": "^0.1.1",
"@global/types": "1.0.0",
"@global/utils": "1.0.0",
"discord.js": "^14.14.1",
"zod": "^3.22.4"
},
"devDependencies": {
"firebase-functions-test": "^3.1.0",
"typescript": "^5.3.3",
"@types/shuffle-seed": "^1.1.3"
}
}
Run npm run build
or npm run deploy
and I get the error