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

error : StyleDictionary.extend is not a function #1346

Open
VijaytaWJ opened this issue Sep 19, 2024 · 0 comments
Open

error : StyleDictionary.extend is not a function #1346

VijaytaWJ opened this issue Sep 19, 2024 · 0 comments

Comments

@VijaytaWJ
Copy link

Hello All,
I am trying to use StyleDictionary as a module, the following is the code.

import StyleDictionary from 'style-dictionary';
// Extend Style Dictionary
const StyleDictionaryExtended = StyleDictionary.extend({
    source: ['tokens/**/*.json'],
    platforms: {
        dart: {
            transformGroup: 'dart',
            buildPath: 'build/dart/',
            files: [
                {
                    destination: 'tokens.dart',
                    format: 'dart/class',
                    className: 'RIBUIT',
                },
            ],
        },
    },
});
StyleDictionaryExtended.buildAllPlatforms();

however i get error as "TypeError: StyleDictionary.extend is not a function " , i checked the path, it is referring to the correct StyleDictonary.js and it does have a extend method, have read many tutorials to double check the configuration but not sure what the issue is

Style dictionary version 4.1.2 and node js version 20.17.0

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