adobe / adobe/leonardo

Module not found: Error: Can't resolve '@adobe/leonardo-contrast-colors'

Open
#173 4 comments 5 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
2.1k
Forks
130
PR merge metrics
No merged PRs in 30d

Description

## Description

Unable to use package. Keep getting "Module not found" or "No exported member" errors.

I have tried both npm and yarn, with CRA and vite.

## Steps to reproduce

1. Initiate a basic application: `npx create-react-app learn-leo`

2. Install package `npm i @adobe/leonardo-contrast-colors`

3. Import Leonardo Package:
```js
// App.js

import * as Leo from "@adobe/leonardo-contrast-colors"

```

4. Run application:`npm start`

5. Resulting error:

```shell
Failed to compile.

Module not found: Error: Can't resolve '@adobe/leonardo-contrast-colors' in '/Users/username/Development/learn-leo/src'
ERROR in ./src/App.js 6:0-50
Module not found: Error: Can't resolve '@adobe/leonardo-contrast-colors' in '/Users/username/Development/learn-leo/src'

webpack compiled with 1 error
```

## Expected behavior

Expected to be able to import and use the leonardo package.

## Screenshots
Screen Shot 2022-08-21 at 2 12 20 PM

## Leonardo package and version
@leonardo-contrast-colors version: ^1.0.0-alpha.16

## Environment
- **Browser(s) and OS(s):**
OS: MacOS: 12.5.1
Browseer: Version 104.0.5112.101 (Official Build) (arm64)

## Additional context
It appears that there may be something wrong with the exposed modules/files for export.

```shell
The package may have incorrect main/module/exports specified in its package.json.
```
---

**UPDATE**: I've tested with Version `1.0.0-alpha.13` and I am no longer seeing this error. It must have something to do with the latest release.

Contributor guide

Open the contributing guide

Research direction

Start with the published package.json and the App.js import shown in the reproduction, comparing version 1.0.0-alpha.16 with alpha.13. Reproduce the install and import using npm or yarn in the stated create-react-app and Vite setups; done means the package resolves and its exports can be used without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, vite
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.