aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
745 stars 128 forks source link

React Native Error #127

Open sayem314 opened 4 years ago

sayem314 commented 4 years ago

Followed install instruction properly and tried basic example but the error is:

image

bearpeta commented 4 years ago

same problem here

florenzen commented 3 years ago

I have the same problem.

The reason is, that - for whatever reason - the jsmediatags.js file from the dist directory gets bundled instead of the jsmediatags.js from the build2 directory of the package. The file from dist is intended for use in a browser (it says "browser": "dist/jsmediatags.js", in package.json) and for React Native, we need the "main": "build2/jsmediatags.js",.

I was able to workaround the problem by simply removing the browser line from package.json. I am completely new to the whole JS world, so I have no clue how to fix this properly.

tha23rd commented 3 years ago

@florenzen thanks for the workaround!

Would be nice for this to be fixed

aadsm commented 3 years ago

@florenzen do you know if this is an issue with React Native bundling the wrong file?

florenzen commented 3 years ago

Yes, I assume that RN packages the wrong file. But I don't know how to change the config such that the correct one is picked up.

avi-l commented 2 years ago

This is still a problem...

error: Error: While trying to resolve modulejsmediatagsfrom fileapp/component/ExtractMetaData.js, the package/node_modules/jsmediatags/package.jsonwas successfully found. However, this package itself specifies amainmodule field that could not be resolved (/node_modules/jsmediatags/dist/jsmediatags.js`. Indeed, none of these files exist:

There is no jsmediatags.js file in the dist/ directory.