style-dictionary-utils
style-dictionary-utils copied to clipboard
Types no longer found when importing filters directly
I am working on upgrading to style dictionary v4, and therefore upgraded the this utils packages to the latest version as well.
I still had module resolution set to node in my tsconfig:
"module": "ESNext",
"moduleResolution": "Node",
Immediately after upgrading, I had the following error in my build.ts file:
Cannot find module 'style-dictionary-utils' or its corresponding type declarations. There are types at '/DesignSystem/node_modules/style-dictionary-utils/dist/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.ts(2307)
I switched module resolution to bundler, which fixed the main import, but now have the following issue that I'm not sure how to resolve:
Cannot find module 'style-dictionary-utils/dist/filter/isDuration.js' or its corresponding type declarations.ts(2307)
Cannot find module 'style-dictionary-utils/dist/filter/isDimension.js' or its corresponding type declarations.ts(2307)
I noticed that types are not explicitly specified in the package.json for style dictionary utils, I wasn't sure if that was a potential cause. I also noticed that this is the first time a package has required me to update my module resolution, and I use other esm only packages, so I'm not entirely sure what is different there.