Closed alexpchin closed 2 years ago
However, this package itself specifies a
main
module field that could not be resolved (/Users/alexchin/ReactNative/trips_mobileapp/node_modules/extract-files/index
The error message sounds incorrect, the extract-files
package does not specify a main
field:
https://github.com/jaydenseric/extract-files/blob/master/package.json
Which is a perfectly valid thing for a package to do. The way to import from extract-files
is to deep import from one of the exported .mjs
ESM modules:
https://github.com/jaydenseric/extract-files#exports
Are we able to continue to support non .mjs moving forwards?
This package will only be in the format which is standard for javascript (ESM) moving forwards.
If your project is non standard CJS, then you can use a dynamic import within the CJS module to import from extract-files
. Otherwise, your best bet is to migrate your project to standard ESM format and then you can import from both CJS and ESM dependencies. Eventually everything maintained on npm will be pure ESM, so it's a problem you need to solve in your project sooner rather than later.
Error: While trying to resolve module
extract-files
from file/Users/alexchin/ReactNative/trips_mobileapp/src/hooks/useSetupApolloClient.js
, the package/Users/alexchin/ReactNative/trips_mobileapp/node_modules/extract-files/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (/Users/alexchin/ReactNative/trips_mobileapp/node_modules/extract-files/index