jeremydaly / lambda-warmer

A module to optimize AWS Lambda function cold starts
MIT License
525 stars 55 forks source link

Circular dependency issue with Rollup #18

Closed xvvvyz closed 1 year ago

xvvvyz commented 5 years ago

Hello. Due to this commit, I'm now seeing these errors when building with Rollup:

$ rollup -ci lambdas/graphql-resolvers/src/resolvers/barrel/index.js -o lambdas/graphql-resolvers/dist/barrel/index.js

lambdas/graphql-resolvers/src/resolvers/barrel/index.js → lambdas/graphql-resolvers/dist/barrel/index.js...
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/json/builder.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/json/builder.js -> /Users/cade/Projects/sam/node_modules/aws-sdk/lib/util.js?commonjs-proxy -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/json/parser.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/protocol/helpers.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/protocol/helpers.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/json.js -> node_modules/aws-sdk/lib/protocol/helpers.js -> /Users/cade/Projects/sam/node_modules/aws-sdk/lib/core.js?commonjs-proxy -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/query.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/query.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/query.js -> node_modules/aws-sdk/lib/query/query_param_serializer.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/query.js -> node_modules/aws-sdk/lib/model/shape.js -> node_modules/aws-sdk/lib/model/collection.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/query.js -> node_modules/aws-sdk/lib/model/shape.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/rest.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/rest_json.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/rest_xml.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/protocol/rest_xml.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/xml/builder.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/model/api.js -> node_modules/aws-sdk/lib/model/operation.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/model/api.js -> node_modules/aws-sdk/lib/model/paginator.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/model/api.js -> node_modules/aws-sdk/lib/model/resource_waiter.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/model/api.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/sequential_executor.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/service.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/service.js -> node_modules/aws-sdk/lib/region_config.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/config.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/config.js -> node_modules/aws-sdk/lib/credentials.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/config.js -> node_modules/aws-sdk/lib/credentials/credential_provider_chain.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/http.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/event_listeners.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/event_listeners.js -> node_modules/aws-sdk/lib/discover_endpoint.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/util.js -> node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/event_listeners.js -> node_modules/aws-sdk/lib/discover_endpoint.js -> node_modules/aws-sdk/lib/util.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/request.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/response.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/resource_waiter.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/v2.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/v3.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/v3https.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/v4.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/v4.js -> node_modules/aws-sdk/lib/signers/v4_credentials.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/s3.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/signers/request_signer.js -> node_modules/aws-sdk/lib/signers/presign.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/core.js -> node_modules/aws-sdk/lib/param_validator.js -> node_modules/aws-sdk/lib/core.js
(!) Circular dependency: node_modules/aws-sdk/lib/node_loader.js -> node_modules/aws-sdk/lib/credentials/temporary_credentials.js -> node_modules/aws-sdk/clients/sts.js -> node_modules/aws-sdk/lib/node_loader.js
(!) Circular dependency: node_modules/aws-sdk/lib/node_loader.js -> node_modules/aws-sdk/lib/credentials/temporary_credentials.js -> node_modules/aws-sdk/clients/sts.js -> /Users/cade/Projects/sam/node_modules/aws-sdk/lib/node_loader.js?commonjs-proxy -> node_modules/aws-sdk/lib/node_loader.js
(!) Circular dependency: node_modules/aws-sdk/lib/node_loader.js -> node_modules/aws-sdk/lib/credentials/cognito_identity_credentials.js -> node_modules/aws-sdk/clients/cognitoidentity.js -> node_modules/aws-sdk/lib/node_loader.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLElement.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLElement.js -> /Users/cade/Projects/sam/node_modules/xmlbuilder/lib/XMLNode.js?commonjs-proxy -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLCData.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLComment.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLDeclaration.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLDocType.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLDocType.js -> node_modules/xmlbuilder/lib/XMLDTDAttList.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLDocType.js -> node_modules/xmlbuilder/lib/XMLDTDEntity.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLDocType.js -> node_modules/xmlbuilder/lib/XMLDTDElement.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLDocType.js -> node_modules/xmlbuilder/lib/XMLDTDNotation.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLRaw.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLText.js -> node_modules/xmlbuilder/lib/XMLNode.js
(!) Circular dependency: node_modules/xmlbuilder/lib/XMLNode.js -> node_modules/xmlbuilder/lib/XMLProcessingInstruction.js -> node_modules/xmlbuilder/lib/XMLNode.js
created lambdas/graphql-resolvers/dist/barrel/index.js in 5.6s

When I revert that commit, everything works as expected:

$ rollup -ci lambdas/graphql-resolvers/src/resolvers/barrel/index.js -o lambdas/graphql-resolvers/dist/barrel/index.js

lambdas/graphql-resolvers/src/resolvers/barrel/index.js → lambdas/graphql-resolvers/dist/barrel/index.js...
created lambdas/graphql-resolvers/dist/barrel/index.js in 2.8s

Let me know if more detail is needed, but this is preventing me from upgrading.

Thanks!

naorpeled commented 1 year ago

Hey @xvvvyz, thanks for opening this issue and sorry for the delayed response.

I'm having trouble with re-producing this issue. Is this is still relevant?

xvvvyz commented 1 year ago

hi @naorpeled. I don't even remember creating this issue 🥲

feel free to close.