jsmediatags icon indicating copy to clipboard operation
jsmediatags copied to clipboard

Fix 'browser' field in package.json

Open pioug opened this issue 3 years ago • 3 comments

dist/jsmediatags.js is not published since https://github.com/aadsm/jsmediatags/commit/2cc8ca5f49d788e360a3a9f18dc425e99ebf2af3

That causes error when using vite:

4:14:56 PM [vite] Internal server error: Failed to resolve entry for package "jsmediatags". The package may have incorrect main/module/exports specified in its package.json.

pioug avatar Aug 02 '21 08:08 pioug

@aadsm can this be merge and released if possible?

lvegerano avatar Nov 04 '21 21:11 lvegerano

Until the author solves this problem, one solution is to use a patch-package from the npm repository.

You just need to add it to the package.json file in your project: "scripts": { "postinstall": "patch-package" }

Then install the package: npm i patch-package

In the package.json file of the jsmediatags package in line 22 substitute the following code for the browser value: "browser": "dist/jsmediatags.min.js",

In te console call: npx patch-package jsmediatags --exclude 'nothing'

And: npm install

Problem solved!

bronisMateusz avatar Jan 01 '23 10:01 bronisMateusz

Im getting this error, after trying the above, is there anything that could help `$ npm install

[email protected] postinstall patch-package

'patch-package' is not recognized as an internal or external command, operable program or batch file. npm ERR! code 1 npm ERR! path C:\Users\essel_r\Desktop\appWriUploads\frontend npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c patch-package

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\essel_r\AppData\Local\npm-cache_logs\2023-05-22T04_17_29_210Z-debug-0.log `

Edit: Run npm i patch-package or you will get the above error

rockyessel avatar May 22 '23 04:05 rockyessel