diff --git a/packages/shared-lib/src/tsr.ts b/packages/shared-lib/src/tsr.ts index 7941d189c3..bbcf93d201 100644 --- a/packages/shared-lib/src/tsr.ts +++ b/packages/shared-lib/src/tsr.ts @@ -1,5 +1,10 @@ import * as TSR from 'timeline-state-resolver-types' export { TSR } -import * as tsrPkgInfo from 'timeline-state-resolver-types/package.json' -export const TSR_VERSION: string = tsrPkgInfo.version +// Dynamically import package.json to avoid import attributes error +const TSR_VERSION = require('timeline-state-resolver-types/package.json').version + +// Below line should work in Node.js 18+ and with bundlers that support import attributes, and replace the above +// import { version as TSR_VERSION } from 'timeline-state-resolver-types/package.json' with { type: 'json' } + +export { TSR_VERSION }