You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bit fails to import or npm install a component when is using multiple module resolution aliases where one of them is a directory of the other.
Steps to Reproduce
create a component bar/foo that consists of the following three files:
src/utils/is-type.js => ''
src/utils/index.js => ''
src/bar/foo => require('@/utils'); require('@utils/is-type');
add the following configuration into the bit.json: resolveModules = { aliases: { '@': 'src' } };
tag and export.
in another workspace, import the component. You'll get the following error
unable to add the file "components/bar/foo/node_modules/@/utils/is-type", because another file "components/bar/foo/node_modules/@/utils" is going to be written.
one of them is a directory of the other one, and is not possible to have them both
Expected Behavior
The import should succeed.
Specifications
Bit version: 14.3.0
Additional context
Running bit cmp bar/foo@latest, shows the following:
davidfirst
changed the title
Import is failed when one module resolution alias is a directory of another alias
bit import fails when one module resolution alias is a directory of another alias
Sep 20, 2019
…ther alias (#2016)
* resolve#2013, fix bit import when one module resolution alias is a directory of another alias
* update bit-javascript to fix a Windows issue when Bit saves dependencies as custom-resolve when they start with "." and the config of module-resolution is set. (although the configured aliases have nothing to do with the dependency in question).
Describe the bug
Bit fails to import or npm install a component when is using multiple module resolution aliases where one of them is a directory of the other.
Steps to Reproduce
bar/foo
that consists of the following three files:src/utils/is-type.js => ''
src/utils/index.js => ''
src/bar/foo =>
require('@/utils'); require('@utils/is-type');
resolveModules = { aliases: { '@': 'src' } };
Expected Behavior
The import should succeed.
Specifications
Additional context
Running
bit cmp bar/foo@latest
, shows the following:Upon import, Bit generates these two link files:
Which is impossible because one is a directory of the other. They can't be both files.
The issue was found by a Gitter user @zeesulehria.
The text was updated successfully, but these errors were encountered: