Skip to content

Conversation

@cloutierMat
Copy link
Member

part of the appsync execution rework, we lost the ability to pass in --experimental-specifier-resolution=node when executing JS code. This is probably a good thing since it could have blocked us from future versions of node.

The sad consequences is that we lost the capabilities to import without specifying the file name for rds and dynamodb.

Explicitly declaring the exports will bring about parity with aws as to how to import appsync-utils module within a user function.

// valid
import * as rds from "@appsync-utils/rds";
import { insert } from "@appsync-utils/rds";

// invalid
import * as rds from "@appsync-utils/rds/index.js";

@cloutierMat cloutierMat marked this pull request as ready for review July 9, 2025 20:28
@cloutierMat cloutierMat requested a review from simonrw July 9, 2025 20:28
@cloutierMat cloutierMat added the bug Something isn't working label Jul 9, 2025
Copy link
Collaborator

@simonrw simonrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame we have to manually declare exports, however I have struggled for ages trying to get this code working across different JS implementations, and I don't understand it all so it was amazing it worked in the first place!

@cloutierMat
Copy link
Member Author

Thanks for the review. Before merging, I will start a changelog in the README, similar to what we have for the airspeed library. That should enable us to properly mange versions of this library in the near future

@cloutierMat cloutierMat marked this pull request as draft July 9, 2025 23:10
@cloutierMat cloutierMat marked this pull request as ready for review July 10, 2025 17:06
@cloutierMat cloutierMat merged commit c588a6a into main Jul 10, 2025
6 of 7 checks passed
@cloutierMat cloutierMat deleted the fix/module-import branch July 10, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants