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

webpack can't find import entry #228

Open
Alex-xd opened this issue Oct 25, 2021 · 4 comments
Open

webpack can't find import entry #228

Alex-xd opened this issue Oct 25, 2021 · 4 comments

Comments

@Alex-xd
Copy link

Alex-xd commented Oct 25, 2021

import { inputToRGB } from '@ctrl/tinycolor';

then inputToRGB is undefined. because it resolved to @ctrl/tinycolor/dist/index.js

but if i change like this it can work.

import { inputToRGB } from '@ctrl/tinycolor/dist/public_api.js';

seem like package.json entry not working here, but others package is fine, only this package has the problem.

my dependency chain is : @ant-design/icons@4.x -> @ant-design/colors@6.x -> @ctrl/tinycolor@3.4.0

@littleLane
Copy link

+1

@scttcper
Copy link
Owner

scttcper commented Apr 9, 2022

can you try editing the @ctrl/tinycolor package.json in your node_modules to

  "main": "./dist/public_api.js",
  "module": "./dist/module/public_api.js",
  "typings": "./dist/public_api.d.ts",

and see if that fixes it for you

@AdrianM
Copy link

AdrianM commented May 30, 2023

I get the same error:
xy.page.ts:74:21-30 - Error: export 'TinyColor' (imported as 'TinyColor') was not found in '@ctrl/tinycolor' (possible exports: default)

The import is import { TinyColor } from '@ctrl/tinycolor';. When I replace it with import { TinyColor } from '@ctrl/tinycolor/dist/public_api.js'; it works.

The suggested modification of the package.json in node_modules did not work.

As a workaround, i added a path in the tsconfig.base.json:
{ "compilerOptions": { "paths": { "@ctrl/tinycolor": ["@ctrl/tinycolor/dist/index.js"] } }

Environment: Apple M1 Ventura, NPM 9.6.7

@lkiarest
Copy link

I get the same error with '@ant-design/icons'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants