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

Compilation fails due to a (documented) bug in axios #5611

Closed
dklischies opened this issue Oct 26, 2020 · 2 comments
Closed

Compilation fails due to a (documented) bug in axios #5611

dklischies opened this issue Oct 26, 2020 · 2 comments
Labels
needs triage This issue has not been looked into type: bug 😭

Comments

@dklischies
Copy link

Regression

Potential Commit/PR that introduced the regression**

b2d1d46

Describe the regression

A regression in axios prevents arbitrary Nest applications from building.

Starting compilation in watch mode...

node_modules/@nestjs/common/node_modules/axios/index.d.ts:62:38 - error TS2304: Cannot find name 'ProgressEvent'.
62   onUploadProgress?: (progressEvent: ProgressEvent) => void;
                                        ~~~~~~~~~~~~~
node_modules/@nestjs/common/node_modules/axios/index.d.ts:63:40 - error TS2304: Cannot find name 'ProgressEvent'.
63   onDownloadProgress?: (progressEvent: ProgressEvent) => void;
                                          ~~~~~~~~~~~~~

The issue was already fixed axios/axios#3219, so all that is required is bumping the Axios version to 0.21.0.

Yarn users can add the following block to their package.json, which serves as a workaround and validates updating the dependency version indeed fixes the issue:

    "resolutions": {
        "@nestjs/common/axios": "0.21.0"
    }

Input Code

This is not dependent on application code. See below for an affected tsconfig.json. In particular, please note that we do not specify nor polyfill any DOM libraries, which triggers the dependency's issue.

Expected behavior/code

Environment


 "@nestjs/common": "^7.4.4"

tsconfig

{
    "compilerOptions": {
        "module": "commonjs",
        "declaration": true,
        "noImplicitAny": false,
        "removeComments": true,
        "lib": ["es2019", "es2020.bigint", "es2020.string", "es2020.symbol.wellknown"],
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es2019",
        "sourceMap": true,
        "outDir": "./dist",
        "baseUrl": "./"
    },
    "exclude": ["node_modules", "dist"]
}
@dklischies dklischies added needs triage This issue has not been looked into type: bug 😭 labels Oct 26, 2020
@jmcdo29
Copy link
Member

jmcdo29 commented Oct 26, 2020

Good callout. We'll work on getting the dependency updated soon.

@kamilmysliwiec
Copy link
Member

Fixed in 7.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: bug 😭
Projects
None yet
Development

No branches or pull requests

3 participants