Comments (11)
@juanjoDiaz I am experiencing the same issue and put yml plugins in order you specified but does not work.
from serverless-plugin-warmup.
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.
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.
Any progress on this?
Can the issue be closed?
from serverless-plugin-warmup.
Same here. Order of plugins does not seem to help
from serverless-plugin-warmup.
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.
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.
@juanjoDiaz sorry to drag this up - Serverless-Plugin-Typescript is under active dev at the moment, can we reopen this?
from serverless-plugin-warmup.
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.
I have circled back around to this and verified using serverless-webpack is the way to go. Solved my issues.
from serverless-plugin-warmup.
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)
- Not working with Serverless Webpack HOT 2
- AWS SDK v3 upgrade is a breaking change HOT 8
- Is @aws-sdk/client-lambda now a peer dependency? HOT 2
- Websocket warmup HOT 2
- warm up plugin webpack bundling issue HOT 5
- Review lifecycle hooks of different plugins to ensure that there are no issues HOT 1
- FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory HOT 2
- Is the pricing still accurate in Readme? HOT 1
- Deployment failed on Windows when using warmup plugin HOT 2
- getting issue when we update nodejs 18.x HOT 2
- How to disable warmers by default, and enable them only for specific lambdas? HOT 2
- Missing folders in warmup lambda once deployed on newer serverless versions HOT 3
- Missing configuration option `alias` from schema
- [Clarification] What is prewarm actually doing? HOT 1
- v8.2.1 requires custom config when used with serverless-esbuild HOT 7
- Description error? HOT 3
- Connection timeout doesn't seem to be working HOT 1
- TypeError: Cannot set properties of null (setting 'WarmUpPluginDefaultRole') HOT 1
- Plugin creates a empty lambda with no code
- Transform failed with 1 error. ERROR: The symbol "i" has already been declared HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-plugin-warmup.