Skip to content

Types no longer found when importing filters directly  #95

@gponnath

Description

@gponnath

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)
image

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)
image

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions