seek-oss / serverless-haskell

Deploying Haskell applications to AWS Lambda with Serverless
MIT License
215 stars 22 forks source link

Support lts 14 #112

Closed nalchevanidze closed 5 years ago

nalchevanidze commented 5 years ago

serverless.yml

provider:
  runtime: haskell
  ...

plugins:
  - serverless-domain-manager
  - serverless-haskell
  - serverless-offline

...

package.json

{
    "devDependencies": {
        "serverless": "1.48.1",
        "serverless-domain-manager": "2.6.6",
        "serverless-haskell": "0.9.1",
        "serverless-offline": "5.12.0"
    }
}

stack.yml

resolver: lts-14.1

extra-deps:
  - morpheus-graphql-0.4.0
  - aeson-1.4.4.0
  - time-compat-1.9.2.2
  - serverless-haskell-0.9.1
  - amazonka-kinesis-1.6.1
  - amazonka-core-1.6.1
  - amazonka-s3-1.6.1

package.yml

dependencies:
  - base >= 4.7 && < 5
  - serverless-haskell >= 0.9.1
  - aeson
  - lens
  - bytestring
  - containers >= 0.4.2.1 && < 0.7
  - split
  - text
  - morpheus-graphql >= 0.4.0

...

with this configuration i try to run sls offline start

but it trows error:

 Type Error ---------------------------------------------

  TypeError: Cannot read property 'serverless-haskell' of undefined
      at ServerlessPlugin.assertServerlessPackageVersionsMatch (./mythology-api/node_modules/serverless-haskell/index.js:180:34)
      at deployedFunctions.forEach.funcName (./mythology-api/node_modules/serverless-haskell/index.js:287:18)
      at Array.forEach (<anonymous>)
      at ServerlessPlugin.buildHandlers (./mythology-api/node_modules/serverless-haskell/index.js:266:34)
      at ServerlessPlugin.buildHandlersLocal (./mythology-api/node_modules/serverless-haskell/index.js:222:14)
nalchevanidze commented 5 years ago

for detailed information you can checkout: https://github.com/morpheusgraphql/mythology-api/pull/2/files

koterpillar commented 5 years ago

serverless-haskell needs to be in dependencies and not devDependencies of the NPM project to work. Is there a reason you don't want to include it there?

koterpillar commented 5 years ago

I've just cloned the repository and branch you specified, and I could run the command without issues.

nalchevanidze commented 5 years ago

sorry for late response, i was little too busy. thank you. i will checkout.

nalchevanidze commented 5 years ago

serverless-haskell needs to be in dependencies and not devDependencies of the NPM project to work. Is there a reason you don't want to include it there?

solved my problem, thank you