Skip to content

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

@skylerknight

Description

@skylerknight

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:

// App.js

import * as Leo from "@adobe/leonardo-contrast-colors"
  1. Run application:npm start

  2. Resulting error:

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions