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

@types/supertest 4.1.14 is breaking in docker build: Cannot find name 'Blob' #1678

Open
pkelly-rh opened this issue Jan 25, 2022 · 5 comments

Comments

@pkelly-rh
Copy link

pkelly-rh commented Jan 25, 2022

Hey guys, thanks for all the good work your doing.
I had to downgrade a project to @types/supertest 4.1.13 since I was getting a weird problem with typescript while building in docker. It came through in the patch version 4.1.14 since we had carrots on ^. I've learned my lesson and locked all the package versions going forward. So we only update when we want to.

But anyways If your interested:

Here's the docker file. Were using node 14-ish

FROM node:14-slim

WORKDIR /usr/src/app

COPY . ./

RUN npm ci
RUN npm run build:packages
RUN npm run build

EXPOSE 3000
CMD [ "npm", "start" ]

Then running docker build
docker build . --progress=plain

The error:

#9 2.857 > tsc --project tsconfig.json                                                                                                                                                                                                                                                     
#9 2.857                                                                                                                                                                                                                                                                                   
#9 7.071 ../../node_modules/@types/superagent/index.d.ts(34,29): error TS2304: Cannot find name 'Blob'.
#9 7.102 npm ERR! code ELIFECYCLE
#9 7.102 npm ERR! errno 2
#9 7.105 npm ERR! @rh-estore-bff/trade-service@1.0.7 build: `tsc --project tsconfig.json`
#9 7.105 npm ERR! Exit status 2
#9 7.105 npm ERR! 
#9 7.105 npm ERR! Failed at the @rh-estore-bff/trade-service@1.0.7 build script.
#9 7.105 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I think this is a configuration issue on our side though. I tried to reproduce this on a git repo without our code and the problem is not there.

@pkelly-rh
Copy link
Author

I think this is our problem on our side... since we are still using node 14 and a cocktail of other old packages in the project

@pkelly-rh pkelly-rh changed the title @types/supertest 4.1.14 is breaking in docker build @types/supertest 4.1.14 is breaking in docker build: Cannot find name 'Blob' Jan 25, 2022
@eynol
Copy link

eynol commented Jan 26, 2022

Same issue. I just lock @types/superagent to 4.1.13 to fix this problem temporarily.

"resolutions": {
   "@types/superagent": "4.1.13"
},

@jwstjacques
Copy link

Can confirm this issue is occurring in a standard build (not docker) as well. Error is a little different.

node_modules/@types/superagent/index.d.ts:23:10 - error TS2305: Module '"buffer"' has no exported member 'Blob'.

This definitely happened recently.

Can also confirm that locking to the "@types/superagent": "4.1.13" did fix the problem, though it's not a great fix in my case.

Commenting in case others experience same issue, and so I can watch this unfold.

@joaopaulo11jp
Copy link

joaopaulo11jp commented Jan 26, 2022

It happened with me too. I was running my build on a node 14 environment while I was depending on @types/node of version 13 which does not export "Blob" from "buffer" module. I solved this chaging the dependency version in package.json:

FROM "@types/node": "^13.9.1" TO "@types/node": "^14.0.1"

@niftylettuce
Copy link
Collaborator

PR welcome to fix?

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

5 participants