scttcper / video-filename-parser

Scene release name parser

Home Page:https://video-filename-parser.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import problem with react native

aldobel opened this issue · comments

Slave everyone, I'm trying to use this library with react native, but on import, it gives me an error:

While trying to resolve module `@ctrl/video-filename-parser` from file `myDirFile.js`,
the package `Dir/node_modules/@ctrl/video-filename-parser/package.json` was successfully found. 
However, this package itself specifies a `main` module field that could not be resolved 
(`myDir/node_modules/@ctrl/video-filename-parser/index`. Indeed, none of these files exist:

I tried adding to the package.json file:

'main': './dist/src/index.js'

without success.
How can I solve this problem? thank you

so the package is now pure esm https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

You could try using an older version 3.7.0 or figuring out how to import and ESM module with your webpack/native setup.