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

fix: AUI compiler assumes tokens always exists #214

Open
nicholasrice opened this issue Jul 11, 2024 · 0 comments
Open

fix: AUI compiler assumes tokens always exists #214

nicholasrice opened this issue Jul 11, 2024 · 0 comments

Comments

@nicholasrice
Copy link
Collaborator

file:///project/node_modules/.pnpm/@[email protected]/node_modules/@adaptive-web/adaptive-ui/dist/esm/bin/aui.js:155
            const properties = style.tokens.reduce((prev, current) => {
                                            ^

TypeError: Cannot read properties of undefined (reading 'reduce')
    at file:///project/node_modules/.pnpm/@[email protected]/node_modules/@adaptive-web/adaptive-ui/dist/esm/bin/aui.js:155:45
    at Array.map (<anonymous>)
    at jsonToAUIStyleSheet (file:///project/node_modules/.pnpm/@[email protected]/node_modules/@adaptive-web/adaptive-ui/dist/esm/bin/aui.js:151:31)
    at Command.<anonymous> (file:///project/node_modules/.pnpm/@[email protected]/node_modules/@adaptive-web/adaptive-ui/dist/esm/bin/aui.js:59:19)

Node.js v20.10.0

When running AUI figma compiler against an anatomy where a style rule does not contain a 'tokens' property, this error is thrown. This is a valid case, so the fix is the just to check for style.tokens prior to reducing it.

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

1 participant