Type Errors for discord.js in Firebase Cloud Functions

Viewed 79

I'm having an issue with discord.js types when deploying in Firebase Cloud Functions.

Not 100% sure how excludes work or if Firebase cares about them but I've tried excluding different combinations of "node_modules", "node_modules/discord.js", "node_modules/discord-api-types", "discord.js", etc in the tsconfig.json to no avail. I'm not sure where to go from here.

Simply importing any module from "discord.js" causes the issue.

Here's the last few lines from the console after an attempted "firebase deploy --only functions":

node_modules/discord.js/typings/index.d.ts:4788:103 - error TS1128: Declaration[430/1865$
ent expected.                                                                            
                                                                                         
4788 export type GuildAuditLogsActions = { [Key in keyof GuildAuditLogsIds as GuildAuditL
ogsIds[Key]]: Key } & { ALL: null };                                                     
                                                                                         
                  ~                                                                      
                                                                                         
node_modules/discord.js/typings/index.d.ts:4788:105 - error TS1109: Expression expected. 
                                                                                         
4788 export type GuildAuditLogsActions = { [Key in keyof GuildAuditLogsIds as GuildAuditL
ogsIds[Key]]: Key } & { ALL: null };                                                     
                                                                                         
                    ~                                                                    
                                                                                         
node_modules/discord.js/typings/index.d.ts:5065:30 - error TS1110: Type expected.        
                                                                                         
5065 export type HexColorString = `#${string}`;                                          
                                  ~~~~                                                   
                                                                                         
node_modules/discord.js/typings/index.d.ts:5204:43 - error TS1110: Type expected.        
                                                                                         
5204 export type MemberMention = UserMention | `<@!${Snowflake}>`;                       
                                               ~~~~~~                                    
                                                                                         
node_modules/discord.js/typings/index.d.ts:5407:5 - error TS1110: Type expected.         
                                                                                         
5407   | `${string}:${Snowflake}`                                                        
         ~~~                                                                             
                                                                                         
node_modules/discord.js/typings/index.d.ts:5698:41 - error TS1110: Type expected.        
                                                                                         
5698 export type RoleMention = '@everyone' | `<@&${Snowflake}>`;                         
                                             ~~~~~~                                      
                                                                                         
node_modules/discord.js/typings/index.d.ts:5930:27 - error TS1110: Type expected.        
                                                                                         
5930 export type UserMention = `<@${Snowflake}>`;                                        
                               ~~~~~                                                     
                                                                                         
                                                                                         
Found 952 errors.                                                                        
                                                                                         
                                                                                         
Error: functions predeploy error: Command terminated with non-zero exit code2   
0 Answers
Related