material-web
material-web copied to clipboard
mwc-tab-bar does not work when importing with unpkg.com
Сmponent @material/mwc-tab-bar does not work when importing with: import 'https://unpkg.com/@material/mwc-tab-bar?module'.
mwc-tab-bar-base.ts imports file mwc-tab-base.ts as import {TabBase} from '@material/mwc-tab/mwc-tab-base';
At the same time file mwc-tab-base.ts imported as nested file in mwc-tab.ts, which is also imported from mwc-tab-bar-base.ts as import {Tab} from '@material/mwc-tab';.
And as a result, this check does not work: .filter((e: Node) => e instanceof TabBase, because the class TabBase declaration is duplicated, because mwc-tab-base.jsis being downloaded repeatedly:

2 files:
https://unpkg.com/@material/[email protected]/mwc-tab-base?module
https://unpkg.com/@material/mwc-tab@%5E0.25.1/mwc-tab-base?module
Example: https://demo-source.github.io/mwc-tab-bar.v1.html https://demo-source.github.io/mwc-tab-bar.v2.html
Problem in https://github.com/material-components/material-web/blob/master/packages/tab-bar/package.json#L20
"@material/mwc-tab": "^0.25.1",
Specifying a floating version results in 2 different import paths
Thanks, for the bug report. We can update the tab imports to use the same path and that should fix this issue.
Obsolete with M3