Skip to content

fix(plugin-swift): Fixes plugin import error#544

Open
pvignau wants to merge 1 commit intoterrazzoapp:mainfrom
pvignau:fix/issue-535
Open

fix(plugin-swift): Fixes plugin import error#544
pvignau wants to merge 1 commit intoterrazzoapp:mainfrom
pvignau:fix/issue-535

Conversation

@pvignau
Copy link
Collaborator

@pvignau pvignau commented Sep 12, 2025

Changes

Fixes #535

Deffering toP3 function var creation fixes the ✗ [config] Cannot read properties of undefined (reading 'channels') error when importing the plugin.

How to Review

  • Build the plugin
  • Use it ✨

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2025

🦋 Changeset detected

Latest commit: 4a14132

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@terrazzo/plugin-swift Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

};
}

const toP3 = toGamut('p3', 'oklch');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think I know what’s happening—Culori relies on side effects to set up, which isn’t great, but just how it works.

Does this work if instead of this, we just added import "culori/css" like here?

The thing I’m worried about is, deferring the load till later doesn’t change the setup; it almost seems like it just relies on something else to load the side effect. So if that changed, then this would break again.

Instead, if we find the necessary setup for the original code to work, then that means this plugin is self-dependent and doesn’t need to be loaded in a specific order to work.

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

Successfully merging this pull request may close these issues.

Error using swift plugin

2 participants