Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

serverless offline startup fails due to serverless-offline-kinesis build error #250

Open
gabsong opened this issue Apr 17, 2023 · 0 comments

Comments

@gabsong
Copy link

gabsong commented Apr 17, 2023

Describe the bug
Cannot find module error. The file https://github.com/CoorpAcademy/serverless-plugins/blob/d25c3103a9ffe94248adfe36f10b21ca979d471b/packages/serverless-offline-kinesis/src/index.js has a combination of common JS and ESM, and this causes build errors on repositories using the serverless-offline-kinesis package.

The repo in which this issue happens has a package.json like the following. Note that there is no "type" property:

{
  "name": "network-api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "author": "",
  "license": "ISC",
  "scripts": {
    "build": tsc,
    "dev": "npx sls offline start  --noPrependStageInUrl"
  },
  "dependencies": {
  }
  "devDependencies": {
    "aws-sdk": "^2.1046.0",
    "serverless": "^3.22.0",
    "serverless-offline": "^8.8.1",
    "serverless-offline-kinesis": "^6.2.3",
    "serverless-plugin-typescript": "^2.1.2",
    "typescript": "^4.9.4"
  }
}

To Reproduce

The project should make use of the serverless-offline-kinesis plugin and serverless-offline.

  1. Invoke the lambda function with serverless offline.
  2. The build will fail and show something like this
    image
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant