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

Wrong serverless-http dependency version in the basic express template

Đang mở
#759 1 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
aws, express, javascript
Lĩnh vực
api, backend, cloud, databases

Hướng nghiên cứu

Bắt đầu với template cơ bản AWS - Node.js - Express API with DynamoDB và kiểm tra dependency serverless-http được khai báo trong đó. So sánh phiên bản của template với môi trường Serverless Framework 3 được báo cáo, cập nhật dependency nếu phù hợp và xác minh rằng serverless deploy --verbose hoàn tất mà không gặp lỗi đã báo cáo.

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

Mô tả

Are you certain it's a bug?
  • Yes, it looks like a bug
Is the issue caused by a plugin?
  • It is not a plugin issue
Are you using the latest v3 release?
  • Yes, I'm using the latest v3 release
Is there an existing issue for this?
  • I have searched existing issues, it hasn't been reported yet
Issue description

When installing the latest serverless version
(Framework Core: 3.31.0
Plugin: 6.2.3
SDK: 4.3.2)

And creating a new template by running the serverless command and choosing the "AWS - Node.js - Express API with DynamoDB" template, the following exception occurs when trying to run serverless deploy:
Recoverable error occurred (Invalid character in entity name Line: 0 Column: 176
after a lot of research, chatGPT helped me to find that the serverless-http version which is ^3.1.1 by default is not compatible with serverless version 3.x.
I've changed serverless-http version to ^2.6.1 per its suggestion and my issue has been solved.

Service configuration (serverless.yml) content
service: test
frameworkVersion: '3'

custom:
  profiles:
    dev: dev
    prod: prod
  tableName: 'users_table_${sls:stage}'

provider:
  name: aws
  runtime: nodejs18.x
  profile: ${self:custom.profiles.${sls:stage}}
  iam:
    role:
      statements:
        - Effect: Allow
          Action:
            - dynamodb:Query
            - dynamodb:Scan
            - dynamodb:GetItem
            - dynamodb:PutItem
            - dynamodb:UpdateItem
            - dynamodb:DeleteItem
          Resource:
            - Fn::GetAtt: [ UsersTable, Arn ]
  environment:
    USERS_TABLE: ${self:custom.tableName}

functions:
  api:
    handler: index.handler
    events:
      - httpApi: '*'

resources:
  Resources:
    UsersTable:
      Type: AWS::DynamoDB::Table
      DeletionPolicy: Retain
      Properties:
        AttributeDefinitions:
          - AttributeName: userId
            AttributeType: S
        KeySchema:
          - AttributeName: userId
            KeyType: HASH
        BillingMode: PAY_PER_REQUEST
        TableName: ${self:custom.tableName}
Command name and used flags

serverless deploy --verbose

Command output
Recoverable error occurred (Invalid character in entity name
Line: 0
Column: 176
Environment information
Framework Core: 3.31.0
Plugin: 6.2.3
SDK: 4.3.2
Ngôn ngữ chính
JavaScript
Star
11.5k
Fork
4.4k
Merge trung bình
2 giờ 55 phút
Pull request đã merge (30 ngày)
3

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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/examples

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

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.