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

'culori/fn' regression in 4.0 #223

Closed
ai opened this issue Jan 26, 2024 · 3 comments
Closed

'culori/fn' regression in 4.0 #223

ai opened this issue Jan 26, 2024 · 3 comments

Comments

@ai
Copy link

ai commented Jan 26, 2024

Seems like there is a regression in 4.0 with 'culori/fn' import because of new itp color space.

Both in Node.js and browser (after Vite):

import { useMode } from 'culori/fn'

Error:

Uncaught ReferenceError: Cannot access 'modeItp' before initialization
    at file:///home/ai/Dev/oklch-picker/node_modules/.pnpm/culori@4.0.0/node_modules/culori/src/index.js:274:28

Seems like we forgot modeItp in ./itp/definition.js.

@danburzo
Copy link
Collaborator

Thanks for the report, @ai. Good catch! I hada meant to fix those references at code-review-time and got sidetracked, seems I forgot.

@danburzo
Copy link
Collaborator

Fixed in culori@4.0.1, thanks for the report! It remains a small puzzle to figure out why test/api.test.js was not throwing this error when importing from src/index-fn.js

@ai
Copy link
Author

ai commented Jan 26, 2024

Thanks for quick fix. oklch.com was moved to 4.x

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

2 participants