question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with serverless-plugin-typescript

See original GitHub issue

Every time I try and package I get:

{ file: undefined,
  start: undefined,
  length: undefined,
  messageText: "File '_warmup/index.ts' not found.",
  category: 1,
  code: 6053,
  reportsUnnecessary: undefined }

  Type Error ---------------------------------------------

  Cannot read property 'getLineAndCharacterOfPosition' of undefined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

TypeError: Cannot read property 'getLineAndCharacterOfPosition' of undefined
    at allDiagnostics.forEach.diagnostic (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/src/typescript.ts:72:47)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/src/typescript.ts:68:18)
    at Generator.next (<anonymous>)
    at /Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/dist/src/typescript.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/dist/src/typescript.js:3:12)
    at Object.run (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/dist/src/typescript.js:62:12)
    at TypeScriptPlugin.<anonymous> (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/src/index.ts:132:42)
    at Generator.next (<anonymous>)
    at /Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/dist/src/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/dist/src/index.js:3:12)
    at TypeScriptPlugin.compileTs (/Users/dsmiley/workspace/mfour-survey-service/node_modules/serverless-plugin-typescript/dist/src/index.js:103:16)
    at BbPromise.reduce (/Users/dsmiley/nvm/versions/node/v11.4.0/lib/node_modules/serverless/lib/classes/PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (/Users/dsmiley/nvm/versions/node/v11.4.0/lib/node_modules/serverless/lib/classes/PluginManager.js:391:22)
    at PluginManager.run (/Users/dsmiley/nvm/versions/node/v11.4.0/lib/node_modules/serverless/lib/classes/PluginManager.js:422:17)
    at variables.populateService.then.then (/Users/dsmiley/nvm/versions/node/v11.4.0/lib/node_modules/serverless/lib/Serverless.js:157:33)
    at processImmediate (timers.js:632:19)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at Serverless.run (/Users/dsmiley/nvm/versions/node/v11.4.0/lib/node_modules/serverless/lib/Serverless.js:144:8)
    at serverless.init.then (/Users/dsmiley/nvm/versions/node/v11.4.0/lib/node_modules/serverless/bin/serverless:44:28)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           11.4.0
     Serverless Version:     1.34.1

I’ve spent a day and half combing through your issues and going through step by step guide with no joy. Any help is greatly appreciated:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
robotlemonscommented, Dec 27, 2018

@juanjoDiaz I am experiencing the same issue and put yml plugins in order you specified but does not work.

3reactions
burkel24commented, Feb 1, 2019

I am able to use serverless-plugin-typescript without issue:

Here is my tsconfig:

{
  "compilerOptions": {
    "baseUrl": ".",
    "preserveConstEnums": true,
    "strictNullChecks": true,
    "sourceMap": true,
    "target": "es5",
    "outDir": ".build",
    "moduleResolution": "node",
    "lib": ["es2015"],
    "rootDir": "./",
    "paths": {
      "*": ["*", "src/*"]
    }
  }
}

Here is the relevant portion of my serverless.yml:

plugins:
  - serverless-plugin-typescript
  - serverless-plugin-chrome
  - serverless-apigw-binary
  - serverless-apigwy-binary
  - serverless-sentry
  - serverless-plugin-warmup
Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless Plugin Typescript
The plugin integrates very well with serverless-offline to simulate AWS Lambda and AWS API Gateway locally. Add the plugins to your serverless.yml file...
Read more >
Fixing serverless typescript, Types of property 'event' are ...
import type {AWS} from "@serverless/typescript";. Make sure that index.ts has scheams and not schema. The final index.ts file is as above. Ref.
Read more >
Node.js Lambda Tracing and Webpack Compatibility
If you are using the serverless-webpack and have the option includeModules set to any value other than false , serverless-webpack automatically packs external ......
Read more >
Serverless Webpack in Lambda Simplified 101 - Learn | Hevo
Lambda functions can be built using a Serverless Webpack plugin. ... and handling webpack-incompatible modules, you may not want to include ...
Read more >
Serverless-bundle NPM - npm.io
serverless -bundle is a Serverless Framework plugin that optimally packages your ES6 or TypeScript Node.js Lambda functions with sensible defaults so you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found