question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect import paths in documentation?

See original GitHub issue

Describe the bug Documentation says:

import { Button } from '@shoelace-style/shoelace/dist/custom-elements';

customElements.define('sl-button', Button);

but in this file, node_modules/@shoelace-style/shoelace/dist/custom-elements/index.mjs I see:

const defineCustomElements = () => {
  [
  SlAlert,
  SlAvatar,
  SlBadge,
  SlButton,
  SlCheckbox,
  SlColorPicker,
  SlDetails,
  SlDialog,
  SlDrawer,
  SlDropdown,
  SlForm,
  SlIcon,
  SlInput,
  SlMenu,
  SlMenuDivider,
  SlMenuItem,
  SlMenuLabel,
  SlProgressBar,
  SlProgressRing,
  SlRadio,
  SlRange,
  SlRating,
  SlSelect,
  SlSpinner,
  SlSwitch,
  SlTab,
  SlTabGroup,
  SlTabPanel,
  SlTag,
  SlTextarea,
  SlTooltip
  ].forEach(cmp => customElements.define(cmp.is, cmp));
};

export { SlAlert, SlAvatar, SlBadge, SlButton, SlCheckbox, SlColorPicker, SlDetails, SlDialog, SlDrawer, SlDropdown, SlForm, SlIcon, SlInput, SlMenu, SlMenuDivider, SlMenuItem, SlMenuLabel, SlProgressBar, SlProgressRing, SlRadio, SlRange, SlRating, SlSelect, SlSpinner, SlSwitch, SlTab, SlTabGroup, SlTabPanel, SlTag, SlTextarea, SlTooltip, defineCustomElements };

So the import would be:

import { SlButton } from '....';

Using 2.0.0-beta.7

Additionally, is there an import path to only import what I need? how would tree-shaking work? is that a stencil issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
claviskacommented, Jul 22, 2020

In collaboration with the Stencil team, we figured out why this build was acting up and a fix has been added in @stencil/core@1.17.0-0. This is a “next” release, but I’ve temporarily upgraded Shoelace to use it given the critical nature of the bug.

The next Shoelace release (2.0.0-beta.8) will be available in a day or so, and will contain the updated docs plus the updated Stencil version. The webpack example repo has already been updated.

Thanks for your patience during this early phase of the project! 😅

1reaction
claviskacommented, Jul 21, 2020

I’m asking about this in the Stencil Slack room. I can’t get them working locally either, which is really strange, since I had it working not long ago.

I’ll update this once I have an answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

incorrect paths for import statement is generated #1405 - GitHub
incorrect paths for import statement can be generated when a project has multiple library workspaces. I think the following issue is similar to ......
Read more >
eslint-plugin-import | Yarn - Package Manager
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
Read more >
Documentation - Module Resolution - TypeScript
Use non-relative paths when importing any of your external dependencies. Module Resolution Strategies. There are two possible module resolution strategies: Node ...
Read more >
5. The import system — Python 3.11.1 documentation
A third default finder searches an import path for modules. The import path is a list of locations that may name file system...
Read more >
Webstorm not resolving module imports using typescript paths
Hello there! I am using Webstorm 2019.3.4 I found it very problematic to configure "paths" option so that IDE does not show me......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found