aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
760 stars 127 forks source link

Fix 'browser' field in package.json #150

Open pioug opened 3 years ago

pioug commented 3 years ago

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.
lvegerano commented 3 years ago

@aadsm can this be merge and released if possible?

bronisMateusz commented 1 year ago

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!

rockyessel commented 1 year ago

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

frontend@0.0.0 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