Open creage opened 2 years ago
It's because this project needs the crypto
module only in Node.js:
https://github.com/universal-geocoder/universal-geocoder-js/blob/4fbeed9cb6f293f95a04c60a963026c2aacb12f2/src/provider/googlemaps/GoogleMapsProvider.ts#L686
Since this library is isomorphic, I needed to use this special function to make it work everywhere:
https://github.com/universal-geocoder/universal-geocoder-js/blob/4fbeed9cb6f293f95a04c60a963026c2aacb12f2/src/utils.ts#L90-L95
That's why TypeScript is telling you that it cannot extract the dependencies statically. It's only a warning though, not an error.
If you find a better way to do it, please tell me.
How about separating browser and node parts? And letting people import just the part they need?
The way it is implemented right now doesn't seem to be universal much. I mean, I can compile, but my CI/CD pipeline won't allow that code.
Trying to build a TypeScript project using Webpack5 throws an error:
Switching to CJS does not help - it fires same error for the cjs/utils.js