You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/helpers/snapshot.ts:2:38 - error TS7016: Could not find a declaration file for module '@percy/core'. '/MY_APP_PATH/node_modules/.pnpm/@[email protected]/node_modules/@percy/core/dist/index.js' implicitly has an 'any' type.
There are types at '/MY_APP_PATH/node_modules/@percy/core/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@percy/core' library may need to update its package.json or typings.
2 import type { SnapshotOptions } from '@percy/core'
In other words, it knows types exist for this package, but due to how the package.json is setup it's not supposed to know 😛
I think this is due to typescript updating how it expects types to be exported (in particular a config update here tsconfig/bases#197 ) - it's to do with these lines
I believe the index types file should be listed under exports"."as well as the types entry in package.json (and the types entry should be kept as fallback for older TS versions)
This stack overflow post explains it pretty well https://stackoverflow.com/a/76212193
The same issue is probably present for a handful of other packages in this monorepo that also export types, but I'm only using core so that's all I've encountered.
Environment
Node version: 18.6.0
@percy/cli version: 1.26.1
The text was updated successfully, but these errors were encountered:
The problem
When I run
tsc --build
I get this errorIn other words, it knows types exist for this package, but due to how the package.json is setup it's not supposed to know 😛
I think this is due to typescript updating how it expects types to be exported (in particular a config update here tsconfig/bases#197 ) - it's to do with these lines
cli/packages/core/package.json
Lines 24 to 32 in 9c89383
I believe the index types file should be listed under
exports
"."
as well as thetypes
entry in package.json (and thetypes
entry should be kept as fallback for older TS versions)This stack overflow post explains it pretty well https://stackoverflow.com/a/76212193
The same issue is probably present for a handful of other packages in this monorepo that also export types, but I'm only using
core
so that's all I've encountered.Environment
@percy/cli
version: 1.26.1The text was updated successfully, but these errors were encountered: