Skip to content

function eject does not work with inline functions without dependencies #2010

@MichalKalke

Description

@MichalKalke

Description

When using function eject on inline function without dependencies the error appears about package.json

Simple inline function:

apiVersion: serverless.kyma-project.io/v1alpha2
kind: Function
metadata:
  name: f-status
spec:
  runtime: nodejs20
  resourceConfiguration:
    function:
      profile: XL
  source:
    inline:
      source: |
        module.exports = {
          main: function(event, context) {
            return 'Hello World!'
          }
        }

Steps to reproduce

kyma function eject f-status -d=path

Error:
  failed to call server

Error Details:
  failed to get runtime files for function 'default/f-status': failed to merge package.json: failed to unmarshal source package.json: unexpected end of JSON input

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions