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

ESM build not updated #173

Closed
fa-sharp opened this issue Aug 25, 2024 · 2 comments · Fixed by #175
Closed

ESM build not updated #173

fa-sharp opened this issue Aug 25, 2024 · 2 comments · Fixed by #175

Comments

@fa-sharp
Copy link

Hey team! I noticed that the flag_name property was missing in flagged transactions when using the SDK, and it seems the underlying issue is that the ESM build (under the dist/esm folder) is not being updated for some reason. This causes ESM bundlers like Parcel to end up with an older version of the SDK. For example, the following file in the ESM build is missing the flag_name property, which means the property won't be parsed:

'approved': json['approved'],
'flag_color': !exists(json, 'flag_color') ? undefined : TransactionFlagColorFromJSON(json['flag_color']),
'account_id': json['account_id'],

The flag_name property does appear in the Common JS build:

'approved': json['approved'],
'flag_color': json['flag_color'] == null ? undefined : (0, TransactionFlagColor_1.TransactionFlagColorFromJSON)(json['flag_color']),
'flag_name': json['flag_name'] == null ? undefined : json['flag_name'],
'account_id': json['account_id'],

Could you take a look? I'm guessing it might have something to do with the OpenAPI Generator that's being used. Let me know if you need more info or if I can help in any way!

@fa-sharp
Copy link
Author

fa-sharp commented Aug 26, 2024

Did some more digging and I think I found the issue - it's the tsBuildInfoFile property in the tsconfig file. The ESM tsconfig needs a separate file for incremental compilation, otherwise it won't generate the new ESM files.

I added "tsBuildInfoFile": "./tsconfig.esm.tsbuildinfo" to the ESM tsconfig file:

"module": "ES2015",
"outDir": "../dist/esm",
"moduleResolution": "node"
}

Then when running the build command, the new ESM files are built as expected in the dist/esm folder.

The generated tsconfig.esm.tsbuildinfo file will also need to be added to .gitignore.

Hope that fixes this, but let me know if you need anything else!

@bradymholt
Copy link
Member

Thanks for the report and help here @fa-sharp ! I've incorporated this fix in #175.

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

Successfully merging a pull request may close this issue.

2 participants