serverless-bundle icon indicating copy to clipboard operation
serverless-bundle copied to clipboard

DEBUG error while getting callsite source context: ENOENT: no such file or directory

Open VED-StuartMorris opened this issue 5 years ago • 4 comments

Wondering if someone could point me in the right direction on this. I have a fairly simple testing function setup using serverless-bundle in which I am receiving a bunch of messages in cloudwatch when it is run.

Screenshot 2020-07-18 at 13 21 33

Example

2020-07-18T12:12:05.926Z	4423b254-bc6b-4399-85af-5f14fd21ea68	DEBUG	error while getting callsite source context: ENOENT: no such file or directory, open '/var/task/src/functions/webpack:/Users/localuser/[LOCAL PATH]/src/functions/orderHistory.js'

It seems to be referring to the [LOCAL PATH] (removed/cleaned for this issue) within the error/message.

Function example:

const handlerFunc = async (event, context) => {
  context.callbackWaitsForEmptyEventLoop = false;
  try {
    if (pool === null) {
      pool = await sql.connect(config);
    }

    console.log("throwing from try");
    throw new CreateError(400, "user id error");
  } catch (err) {
    // Capture Error in Serverless, will also console.error the err object
    context.serverlessSdk.captureError(err);

    console.log("throwing from catch");
    throw new CreateError.UnprocessableEntity();
  }
};
export const handler = middy(handlerFunc).use(cors()).use(httpErrorHandler());

VED-StuartMorris avatar Jul 18 '20 12:07 VED-StuartMorris

This seems to come up when I have the following serverless configuration

package:
    individually: true

-- and using the default bundle / sourcemaps true.

VED-StuartMorris avatar Jul 18 '20 15:07 VED-StuartMorris

Hmmm can you create a test repo with the issue? It looks like some files aren't getting included correctly?

jayair avatar Jul 19 '20 17:07 jayair

@VED-StuartMorris did you solve this somehow? Experiencing the same

luddilo avatar May 11 '22 09:05 luddilo

@VED-StuartMorris has this been solved yet?

JerryAgbesi avatar Dec 29 '22 14:12 JerryAgbesi