opensearch-project / opensearch-ci

Enables continuous integration across OpenSearch, OpenSearch Dashboards, and plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Cannot find module 'aws-lambda' or its corresponding type declarations

gaiksaya opened this issue · comments

Describe the bug

When someone clones the repo and tries to run npm run build, we are seeing below error:

resources/cf-url-rewriter/cf-url-rewriter.ts:9:95 - error TS2307: Cannot find module 'aws-lambda' or its corresponding type declarations.

9 import { CloudFrontRequest, CloudFrontRequestCallback, CloudFrontRequestEvent, Context } from 'aws-lambda';
                                                                                                ~~~~~~~~~~~~


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! opensearch-ci-stack@0.1.0 build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the opensearch-ci-stack@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Workaround currently is:

cd resources/cf-url-rewriter
npm install

To reproduce

Clone this repo
Run npm install and then npm run build

Expected behavior

npm install should take care of main as well as child node packages.

Screenshots

If applicable, add screenshots to help explain your problem.

Host / Environment

No response

Additional context

No response

Relevant log output

No response

running npm run build inside the resources dir first and then running it from root of the project would resolve the issue. Permanent solution will be move to the lamabda's package.json dependencies to project's package.json.
I will take it up and create a PR @gaiksaya

Since that project is not used anymore, can we just remove it? I believe we are not using that library/module now from opensource

We do have the optional cdn stack in the opensource project.