rsdoiel/mimetype-js

it does not work in react native

Closed this issue · 6 comments

I have this error when trying to use this module in my react native package

Unable to resolve module path from /node_modules/mime-types/index.js: MOdule does not exist in the module map

@Liroo do u think it is worth send a PR to this package?

Liroo commented

Maybe it's worth it to keep my git hub, but I will do some test if my own fork is compatible with the original repository :) 🚀

Hello, I rarely write NodeJS/npm code these days so am not up on the current practices. I have never written anything requiring React so do not know that is requires. Sorry for my ignorance. This package was written back when NodeJS was young Ryan Dahl was still very much involved.

From your description I would guess that React is looking for index.js exclusively to know what to pull in to its system. You could try symbolically linking mimetype.js (or renaming) to index.js and see if that works.

Liroo commented

The fact is there is no path module on react-native, I recode a basic path.extname for compatibility

Furthermore, I add yarn.lock feature which is a node.js packager

Sounds good. Feel free to send a pull request, if this is something that will help others. All the best Robert