serverless-plugin-typescript icon indicating copy to clipboard operation
serverless-plugin-typescript copied to clipboard

Don't try to access properties of undefined diagnostic file object

Open MennoTammens opened this issue 2 months ago • 0 comments

When compiling with node20.x or node22.x, I got this error:

{
  file: undefined,
  start: undefined,
  length: undefined,
  code: 2688,
  category: 1,
  messageText: {
    messageText: "Cannot find type definition file for 'glob'.",
    category: 1,
    code: 2688,
    next: [ [Object] ]
  },
  relatedInformation: undefined
}

Error:
TypeError: Cannot read properties of undefined (reading 'getLineAndCharacterOfPosition')
    at node_modules/serverless-plugin-typescript/dist/src/typescript.js:85:57

MennoTammens avatar Oct 06 '25 08:10 MennoTammens