jsmediatags icon indicating copy to clipboard operation
jsmediatags copied to clipboard

React Native Error

Open sayem314 opened this issue 6 years ago • 6 comments

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

image

sayem314 avatar Apr 09 '20 10:04 sayem314

same problem here

bearpeta avatar Apr 16 '20 05:04 bearpeta

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.

florenzen avatar Sep 18 '20 21:09 florenzen

@florenzen thanks for the workaround!

Would be nice for this to be fixed

tha23rd avatar Oct 06 '20 12:10 tha23rd

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

aadsm avatar Mar 01 '21 04:03 aadsm

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.

florenzen avatar Mar 02 '21 11:03 florenzen

This is still a problem...

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

  • /node_modules/jsmediatags/dist/jsmediatags.js(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • /node_modules/jsmediatags/dist/jsmediatags.js/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`

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

avi-l avatar May 29 '22 08:05 avi-l