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

Update mime dependency to ^4.0.0 #2434

Closed
thelinuxlich opened this issue Apr 1, 2024 · 10 comments
Closed

Update mime dependency to ^4.0.0 #2434

thelinuxlich opened this issue Apr 1, 2024 · 10 comments
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@thelinuxlich
Copy link

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

image

@thelinuxlich thelinuxlich added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 1, 2024
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Apr 1, 2024
@ddelgrosso1
Copy link
Contributor

ddelgrosso1 commented Apr 1, 2024

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 ddelgrosso1 self-assigned this Apr 1, 2024
@MarcAntoineLebourgeois
Copy link

+1 got the same error

@ddelgrosso1
Copy link
Contributor

ddelgrosso1 commented Apr 2, 2024

@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?

@thelinuxlich
Copy link
Author

Node 20, here's the output:

And it started happening after a pnpm -r up indeed

image

@thelinuxlich
Copy link
Author

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

@thelinuxlich
Copy link
Author

Another one: firebase/firebase-admin-node#2512

@ddelgrosso1
Copy link
Contributor

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

@climba03003
Copy link

climba03003 commented Apr 2, 2024

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 firebase/firebase-admin-node#2512 (comment) and the proper fix should be fixing the wrong linked package (e.g. @types/serve-static) instead of this library.

Reference to shown that fastify/send#60 (comment)
Without install @types/mime, it should be good to use inside TypeScript.

@ddelgrosso1
Copy link
Contributor

ddelgrosso1 commented Apr 2, 2024

I did some sanity checking and as @climba03003 noted this library is using @types/mime ^3.0.0.

"@types/mime": "^3.0.0",

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

@ddelgrosso1
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants