material-web icon indicating copy to clipboard operation
material-web copied to clipboard

mwc-tab-bar does not work when importing with unpkg.com

Open IgorNovozhilov opened this issue 4 years ago • 1 comments

С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:

Снимок экрана от 2021-09-29 19-59-29

Снимок экрана от 2021-09-29 20-07-12 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

IgorNovozhilov avatar Sep 29 '21 17:09 IgorNovozhilov

Thanks, for the bug report. We can update the tab imports to use the same path and that should fix this issue.

dfreedm avatar Sep 30 '21 18:09 dfreedm

Obsolete with M3

asyncliz avatar Aug 02 '23 02:08 asyncliz