Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript errors when deploying to Firebase Cloud Functions #32

Open
julienlebren opened this issue Jun 26, 2024 · 4 comments
Open

TypeScript errors when deploying to Firebase Cloud Functions #32

julienlebren opened this issue Jun 26, 2024 · 4 comments

Comments

@julienlebren
Copy link

This package is totally unusable because its code does not compile...

node_modules/@getbrevo/brevo/dist/api/accountApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/companiesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/contactsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/conversationsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/couponsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/dealsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/domainsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/ecommerceApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/emailCampaignsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/eventsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/externalFeedsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/filesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/inboundParsingApi.d.ts:3:8 - error TS1192: Module '"http"' has no default export.

3 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/masterAccountApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/notesApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/paymentsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/processApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/resellerApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/sendersApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/sMSCampaignsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/tasksApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/transactionalEmailsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/transactionalSMSApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/transactionalWhatsAppApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/userApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/webhooksApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/api/whatsAppCampaignsApi.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

node_modules/@getbrevo/brevo/dist/model/models.d.ts:3:8 - error TS1259: Module '"/Users/julienlebren/node_modules/@types/request/index"' can only be default-imported using the 'esModuleInterop' flag

3 import localVarRequest from 'request';
         ~~~~~~~~~~~~~~~

  node_modules/@types/request/index.d.ts:395:1
    395 export = request;
        ~~~~~~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.


Found 28 errors in 28 files.

Errors  Files
     1  node_modules/@getbrevo/brevo/dist/api/accountApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/companiesApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/contactsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/conversationsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/couponsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/dealsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/domainsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/ecommerceApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/emailCampaignsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/eventsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/externalFeedsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/filesApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/inboundParsingApi.d.ts:3
     1  node_modules/@getbrevo/brevo/dist/api/masterAccountApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/notesApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/paymentsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/processApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/resellerApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/sendersApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/sMSCampaignsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/tasksApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/transactionalEmailsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/transactionalSMSApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/transactionalWhatsAppApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/userApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/webhooksApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/api/whatsAppCampaignsApi.d.ts:2
     1  node_modules/@getbrevo/brevo/dist/model/models.d.ts:3

Error: functions predeploy error: Command terminated with non-zero exit code 2

@TracKer
Copy link

TracKer commented Aug 15, 2024

@julienlebren Did you find a solution to the issue?

@julienlebren
Copy link
Author

julienlebren commented Sep 3, 2024

I edited all the files manually and changed import * http from 'http'; to import * as http from 'http';

A shame that Brevo is not fixing this and released something completely bugged.
And no reply from the team after 2 months... really not a serious company.

@mr-jstraub
Copy link

+1
same issue here

@gmarizy
Copy link

gmarizy commented Nov 18, 2024

Adding "esModuleInterop": true, in compilerOptions of my tsconfig.json seems to solve the problem. But I don't know the consequences of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants