Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

V4 - sls deploy does not throw if handler path is incorrect or does not exist

Đang mở
#12,970 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
aws, javascript
Lĩnh vực
backend, cloud

Hướng nghiên cứu

Bắt đầu bằng cách xác định các entry point của deploy và package, rồi tái hiện trường hợp serverless.yml được cung cấp với handler không tồn tại madeUpPath. Theo dõi cách các đường dẫn handler được xác thực trong quá trình đóng gói và triển khai; công việc được xem là hoàn tất khi cả hai hàm đều từ chối đường dẫn handler không hợp lệ hoặc bị thiếu thay vì âm thầm thực thi thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

v3
Issue description

We experienced a bug recently because the path to a handler in our serverless.yml was incorrect but sls deploy succeeded, giving no indication that anything was wrong. On inspection, the only indicator was that the file size for the deployed zip was 1.2kb.

The deploy and package functions should throw if a path is invalid

Context
service: test-api

package:
  individually: true

build:
  esbuild:
    configFile: ./config/esbuild.config.js

provider:
  name: aws
  profile: ***
  deploymentMethod: direct
  versionFunctions: false
  runtime: nodejs22.x
  memorySize: 1536
  region: ${opt:region, 'eu-west-2'}
  stage: ${opt:stage}
functions:
  testHandler:
    handler: handlers/madeUpPath.default <-- does not exist

Output when running sls deploy function -f testHandler -s dev:

⠏ Initializing(node:42618) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Deploying function "testHandler" to stage "dev" (eu-west-2)
Loading AppSync config
⠋ Uploading (1.2 kB)
✔ Function code deployed (1s)
Retrying configuration update for function: testHandler. Reason: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:eu-west-2:531882032324:function:test-api-dev-testHandler
✔ Function configuration updated (2s)

Retrying ensure function state for function: testHandler.
Retrying ensure function state for function: testHandler.
Ngôn ngữ chính
JavaScript
Star
46.9k
Fork
5.7k
Merge trung bình
12 giờ 57 phút
Pull request đã merge (30 ngày)
61

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của serverless/serverless

Tất cả issue của serverless/serverless

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.