Giter VIP home page Giter VIP logo

Comments (11)

robotlemons avatar robotlemons commented on August 24, 2024 4

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

from serverless-plugin-warmup.

burkel24 avatar burkel24 commented on August 24, 2024 3

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

from serverless-plugin-warmup.

juanjoDiaz avatar juanjoDiaz commented on August 24, 2024

The error seems to be related to TypeScript. It can happen if you have an invalid tsconfig.app.json or tsconfig.json or if you have invalid code like a getter without a return.

This might also be caused because serverless-plugin-typescript doesn't support plain js handlers (see serverless/serverless-plugin-typescript#78) and warmup uses a plain js handler.
To fix that you can try to declare serverless-plugin-typescript before serverless-plugin-warmup in your serverless.yaml so serverless-plugin-typescript doesn't try to process the lambda function.

plugins:
  - serverless-plugin-typescript
  - serverless-plugin-warmup

from serverless-plugin-warmup.

juanjoDiaz avatar juanjoDiaz commented on August 24, 2024

Any progress on this?
Can the issue be closed?

from serverless-plugin-warmup.

cryptiklemur avatar cryptiklemur commented on August 24, 2024

Same here. Order of plugins does not seem to help

from serverless-plugin-warmup.

dsmileym4 avatar dsmileym4 commented on August 24, 2024

Thank you for suggested fixes. I haven't had a chance to revisit this in our code. We implemented a work around which has to be removed to test this. If anyone else can verify this fix works please close this issue. It will be a while before we have any resources to verify.

from serverless-plugin-warmup.

juanjoDiaz avatar juanjoDiaz commented on August 24, 2024

I'll close this for now.

It seems clear that the problem is in serverless-plugin-typescript (which seems to be abandoned, so serverless-webpack might be a better option) and there seems to be a workaround.

Feel free to reopen if there is anything else.

from serverless-plugin-warmup.

claridgicus avatar claridgicus commented on August 24, 2024

@juanjoDiaz sorry to drag this up - Serverless-Plugin-Typescript is under active dev at the moment, can we reopen this?

from serverless-plugin-warmup.

juanjoDiaz avatar juanjoDiaz commented on August 24, 2024

Is there anything that we can do here, @claridgicus?

The problem, as stated in serverless/serverless-plugin-typescript#79, is in the typescript plugin, so they just have to fix it. There isn't much that we can do...

Personally, I switched to https://www.npmjs.com/package/serverless-webpack long time ago. 🙂

from serverless-plugin-warmup.

dsmileym4 avatar dsmileym4 commented on August 24, 2024

I have circled back around to this and verified using serverless-webpack is the way to go. Solved my issues.

from serverless-plugin-warmup.

piaverous avatar piaverous commented on August 24, 2024

I have run into this issue in a full typescript setup. serverless/serverless-plugin-typescript#79 was not enough to fix the issue for me, as I have (and need to keep) allowJs: false in my tsconfig.json.

serverless package would then error the following way

{ file: undefined,
  start: undefined,
  length: undefined,
  messageText: 'File \'_warmup/index.js\' has unsupported extension. The only supported extensions are \'.ts\', \'.tsx\', \'.d.ts\'.',
  category: 1,
  code: 6054,
  reportsUnnecessary: undefined }

It would be too costly for me to migrate to serverless-webpack, so I opened this PR to allow for generating the handler function in Typescript directly instead of JS:
#176

It works for me, but was wondering if there was a reason for not doing this?

from serverless-plugin-warmup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.