-
-
Notifications
You must be signed in to change notification settings - Fork 23
Nuxt 3 compatibility #947
Comments
This is because your project is running in a browser environment and process and Buffer are in Node.js. Here's how I solved it:
And then register these two globally
|
Not sure this has anything to do with Nuxt as I'm not using that and running into the same issue. As a "browser" version of music-metadata, no idea why this uses Node.js dependencies |
Related: vitejs/vite#2785 (Using (Node’s) Buffer in your polymorphic Vite apps...) |
Should not be using |
What would you recommend instead of |
@artshade I don't use this lib anymore, but from what I remember Buffer is only used in a few places (2 or 3?) and the lines using The polyfills just port your Node.js I'm personally used to using Buffer in all of my Node.js projects and I think the API is way nicer, but just using ArrayBuffer isn't that much of a big deal and can easily be achieved. |
Buffer is not o
Certainly not 2 or 3 places, probably few hundred places.
How would for example replace the |
Sorry, I only remember changing about 2-3 places where Buffer was used (was a while ago so I don't remember). Buffer.fromString is replaced with TextEncoder, available in Node.js >= 11.0.0, Chrome >= 38, Firefox >= 18, etc. Example: const array: ArrayBuffer = new TextEncoder().encode("hello world").buffer; ( edit: MDN actually recommends using
|
Related to #417, maybe this will be a game changer: Borewit/token-types#650 |
mmb is throwing an error when trying to parseBlob. Could be fixed by polyfilling, but process.nextTick is also required by mmb but already set with a custom function from Nuxt, so polyfilling it is not an option.
The text was updated successfully, but these errors were encountered: