nodejs-storage icon indicating copy to clipboard operation
nodejs-storage copied to clipboard

Update mime dependency to ^4.0.0

Open thelinuxlich opened this issue 1 year ago • 9 comments

The mime package broke today everywhere for 3.0 with messages like this:

image

thelinuxlich avatar Apr 01 '24 17:04 thelinuxlich

I'll take a look at what we can do. It does not look like updating to 4.x is possible as it appears it requires Node >= 16 and we are currently still supporting >= 14. Additionally, it appears 4.x is pure ESM.

ddelgrosso1 avatar Apr 01 '24 17:04 ddelgrosso1

+1 got the same error

MarcAntoineLebourgeois avatar Apr 02 '24 09:04 MarcAntoineLebourgeois

@MarcAntoineLebourgeois or @thelinuxlich can either of you provide a bit more context. Were you upgrading this library? If so from what version to what version? What is the output from npm ls mime? What is the version of node you are using?

ddelgrosso1 avatar Apr 02 '24 14:04 ddelgrosso1

Node 20, here's the output:

And it started happening after a pnpm -r up indeed

image

thelinuxlich avatar Apr 02 '24 14:04 thelinuxlich

You can see a @types/[email protected] there, I had to force it with overrides on the package.json to make it work.

thelinuxlich avatar Apr 02 '24 14:04 thelinuxlich

Another one: https://github.com/firebase/firebase-admin-node/issues/2512

thelinuxlich avatar Apr 02 '24 14:04 thelinuxlich

Thanks @thelinuxlich I'll take a closer look at what could be happening.

ddelgrosso1 avatar Apr 02 '24 14:04 ddelgrosso1

Just want to add my two cent on this issue. googleapis/nodejs-storage is using the correct version of @types/mime in dev dependencies.

Since there is no @types/mime is provided, any @types/mime install will cause problem. But wait, it is not a problem of googleapi/nodejs-storage. What we should done is find out which exact package is linking the @types/mime@4. Similar to https://github.com/firebase/firebase-admin-node/issues/2512#issuecomment-2029100180 and the proper fix should be fixing the wrong linked package (e.g. @types/serve-static) instead of this library.

Reference to shown that https://github.com/fastify/send/issues/60#issuecomment-2030997289 Without install @types/mime, it should be good to use inside TypeScript.

climba03003 avatar Apr 02 '24 14:04 climba03003

I did some sanity checking and as @climba03003 noted this library is using @types/mime ^3.0.0. https://github.com/googleapis/nodejs-storage/blob/36d27212848a1002cc0fa699364a446c4f8d25e4/package.json#L102

I don't think there is a fix to be made in this library.

ddelgrosso1 avatar Apr 02 '24 15:04 ddelgrosso1

Going to close this out as there does not appear to be anything to be done on the storage library side.

ddelgrosso1 avatar Apr 05 '24 15:04 ddelgrosso1