This PR fix a case of false positive duplicate namespace error.
There is no test for this case yet, as it is hard to reproduce with our infra, but these are the details:
nextjs in app directory mode
external stylable lib with
components with stylable base
component variants that import the base as interface
user project import (Javascript):
component (-> import base stylesheet)
variant to style the component (-> import base stylesheet)
For some reason, although both imports (component & variant) are resolving the same base stylesheet, webpack is generating 2 modules, one with absolute path from the variant and one relative path from the component.
Our duplicate namespace check gets both modules, with the same namespace! and report the error.
The fix is to filter out the module that is being imported from the variant as it is only used as an interface and isn't important for this check. This is done by checking the isUsed flag we already provide for the module.
This PR fix a case of false positive
duplicate namespace
error.There is no test for this case yet, as it is hard to reproduce with our infra, but these are the details:
nextjs
in app directory modeFor some reason, although both imports (component & variant) are resolving the same base stylesheet,
webpack
is generating 2 modules, one with absolute path from the variant and one relative path from the component.Our
duplicate namespace
check gets both modules, with the same namespace! and report the error.The fix is to filter out the module that is being imported from the variant as it is only used as an interface and isn't important for this check. This is done by checking the
isUsed
flag we already provide for the module.