Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Combo-box]: Module not found error #11635

Closed
2 tasks done
gyalogmixi opened this issue Mar 14, 2024 · 1 comment · Fixed by #11639
Closed
2 tasks done

[Combo-box]: Module not found error #11635

gyalogmixi opened this issue Mar 14, 2024 · 1 comment · Fixed by #11639
Labels
bug Something isn't working dev Needs some dev work owner: Innovation Team used when the engineering work will be done by Hybrid Cloud with DDS engineers as consultants package: carbon web components

Comments

@gyalogmixi
Copy link
Contributor

Description

For a project I use Laravel Mix as a wrapper for Webpack. When I call npm run production I encounter this error.

ERROR in ./node_modules/@carbon/web-components/es/components/combo-box/combo-box.js 25:0-54
Module not found: Error: Package path ./directives/if-defined is not exported from package /workspace/node_modules/lit (see exports field in /workspace/node_modules/lit/package.json)
Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".",".wasm",".mjs",".js",".jsx",".json"]' instead of '["",".wasm",".mjs",".js",".jsx",".json"]'?

Component(s) impacted

Combo-box

import { ifDefined } from 'lit/directives/if-defined';

When I change it to import { ifDefined } from 'lit/directives/if-defined.js'; it works fine.

Browser

No response

Carbon for IBM.com version

2.5.0

Severity

Severity 4 = The problem is not visible to or noticeable to an average user. Affects minor functionality, no workaround needed.

Application/website

custom web application

Package

@carbon/web-components

CodeSandbox example

https://codesandbox.io/p/sandbox/modest-fermi-fgs9hv

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

@gyalogmixi gyalogmixi added bug Something isn't working dev Needs some dev work labels Mar 14, 2024
m4olivei referenced this issue Mar 15, 2024
### Related Ticket(s)

Closes #11268
[Jira ticket](https://jsw.ibm.com/browse/ADCMS-4401)

### Description

Fixes accessibility issues with Combo-box, and by extension Dropdown.

Used both React package (which uses [Downshift](https://www.downshift-js.com/)), and [ARIA APG](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) as references. Tested with VoiceOver on Mac OS.

### Testing

* Use both dropdown and combo-box components. Ensure there are no regressions for sighted users
* Using a screenreader, test both dropdown and combo-box components. Should work well. See [Select-Only Combobox Example](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/) and [Editable Combobox With List Autocomplete Example](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/) are great reference examples.
* Regression test the Multi select component (it extends the Dropdown component)

### Changelog

**Changed**

- Improved dropdown and combo-box accessibility.

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
@nolrinale
Copy link

nolrinale commented Mar 18, 2024

@kennylam Can confirm this is happening in our project as well, we are unable to fully compile carbon web components to use into our project anymore. Using Vite + Storybook 7 btw, feel free to accept this PR that seems to have fixed the issue #11639

@kodiakhq kodiakhq bot closed this as completed in #11639 Mar 19, 2024
kodiakhq bot pushed a commit that referenced this issue Mar 19, 2024
### Related Ticket(s)

Closes #11635

### Description

Adds the file extension to the import path for `lit/directives/if-defined.js` to fix issues with some bundlers.

### Changelog

**Changed**

- Adds the file extension to the import path for `lit/directives/if-defined.js` to fix issues with some bundlers.

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
@annawen1 annawen1 added the owner: Innovation Team used when the engineering work will be done by Hybrid Cloud with DDS engineers as consultants label Mar 20, 2024
kennylam pushed a commit to kennylam/carbon-for-ibm-dotcom that referenced this issue Mar 20, 2024
…m#11639)

Closes carbon-design-system#11635

Adds the file extension to the import path for `lit/directives/if-defined.js` to fix issues with some bundlers.

**Changed**

- Adds the file extension to the import path for `lit/directives/if-defined.js` to fix issues with some bundlers.

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
kennylam pushed a commit to kennylam/carbon-for-ibm-dotcom that referenced this issue Jun 11, 2024
…m#11639)

### Related Ticket(s)

Closes carbon-design-system#11635

### Description

Adds the file extension to the import path for `lit/directives/if-defined.js` to fix issues with some bundlers.

### Changelog

**Changed**

- Adds the file extension to the import path for `lit/directives/if-defined.js` to fix issues with some bundlers.

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Needs some dev work owner: Innovation Team used when the engineering work will be done by Hybrid Cloud with DDS engineers as consultants package: carbon web components
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants