Skip to content

Unsupported handler extension for module #58

@kboek

Description

@kboek

In serverless.yml (excerpt for brevity)

plugins:
  - serverless-middleware

custom:
  middleware:
    pre:
      - auth/authorize.handler

In auth/authorize.js

module.exports.handler = async (event, context) => {
  try {
    // authorization happens here
  } catch (e) {
    // error handling
  }
}

When I run sls deploy or sls package, I get "Unsupported handler extension for module ./auth/authorize. Only .js, .jsx, .ts and .tsx are supported"

This happened after upgrading to SLS 4 and serverless-middleware 3.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions