module-alias
module-alias copied to clipboard
Bug: require loads local file instead of node_modules package
It seems that when there is a local file called the same as an existing package (let's assume stripe
package and stripe.js
file) and you are trying to load the package, local file is loaded instead.
require('stripe') // loads local stripe.js file
expected behaviour:
require('stripe') // should load `stripe` package
require('./stripe') // should load local stripe.js file
Hm, I'm not sure if it's caused by module-alias but will check it
I'm having a similar issue, getting an error because it's trying to get a local file instead of dependency. Issue only happening when I define aliases in package.json and import module-alias/register
, not when calling .addAliases() directly.