NodeRequirer
NodeRequirer copied to clipboard
Bug when requiring a namespaced dependency
The bug is in the utils, when it tries to determine wheter a module is local or not.
https://github.com/ganemone/NodeRequirer/blob/4eed13a166cb5a8842fa84077abc66e50250db45/src/utils.py#L70-L71
For example, for a npm package @someNamespace/package it breaks.
is_local_file should make a better check, for example that it starts with (or includes) a dot.
Probably related: in this scenario one can clearly see that NodeRequirer see as valid (green) che second one, which is not the right way to import it - and also marked red by eslint. The first one which actually works is not seen as valid.
To be fair, the main level require like require('@ildella/frankie-lib/') would actually work in NodeRequirer. It is the internal module, which is properly define in the package.json exports field, to not be seen as valid.