TypeScript and Serverless Memory Issue
Change the file to add the follow codes at the top
/opt/node/lib/node_modules/serverless/bin/serverless
#!/usr/bin/env node --max-old-space-size=3000 --trace-gc-verbose
JavaScript heap out of memory error.
It fails as well
Serverless Error ---------------------------------------
An error occurred: DevicePairingUpdatesLambdaFunction - Unzipped size must be smaller than 262144000 bytes (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 94dddcf0-b153-11e8-81e6-771d442f6caf).
> node --version && sls --version
v8.10.0
1.30.0
It is claimed that after serverless 1.16.0, the dev dependencies are excluded.
https://github.com/serverless/serverless/releases/tag/v1.16.0
Once thing I notices in my case is that, I have a large js and map.js. I do not have node_modules.
Upgrade the NPM
> sudo npm i -g npm
Upgrade my serverless
> sudo npm i -g serverless
Follow command will generate a zip file in .serverless directory, we can check the size of the package there
> sls package
Check out version
> npm info @lifesize/tscommon version
0.1.20
I did the npm cache clean, but I still did not get the latest version
> npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
The NPM package things may related to our deployment and CircleCI
Follow this
https://docs.npmjs.com/getting-started/publishing-npm-packages
We need run
npm version patch and npm publish
In my current case, I only need to run
npm version patch and push that to GitHub.com and then
In the release page on GitHub.com like https://github.com/sillycat/projectName/releases —> “Draft a new release"
Or we can do tag as well.
https://stackoverflow.com/questions/18216991/create-a-tag-in-github-repository
>git tag -a v1.1.1 -m “description of this tag”
>git push - - tags
List all the tags
>git tag
The project size is related to webpack and npm local package.
References:
https://www.jeremydaly.com/how-to-optimize-the-serverless-optimizer-plugin/
http://www.goingserverless.com/blog/keeping-dev-dependencies-out-of-your-serverless-package
https://github.com/serverless/serverless/releases/tag/v1.16.0
分享到:
相关推荐
Malagu 是基于 TypeScript 的 Serverless First、组件化、平台无关的渐进式应用框架。约定大于配置,零配置,开箱即用。TypeScript 版 Spring Boot。Serverless First。平台不锁定。支持前后端一体化,前端框架不...
Building Web Components with TypeScript and Angular 4 by Matthew Scarpino English | 10 Jun. 2017 | ASIN: B071K4HWMT | 603 Pages | AZW3 | 2.11 MB Angular is Google's foremost framework for developing ...
serverless-plugin-typescript, 无服务器插件,支持零配置 serverless-plugin-typescript 无服务器插件,支持零配置特性零配置:不需要安装任何其他编译器或者插件就可以使用这个框支持ES2015语法 特性( export,...
详细介绍用EC6+构建Apps,使用React开发SPA应用,用create-react-app安装项目、Redux、React Router、TypeScript, Node用Express和GraphQL开发WEB服务等内容。
Building Web Components with TypeScript and Angular 4 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自...
Vercel上的TypeScript无服务器API 该目录是在TypeScript中创建无服务器API并在Vercel平台上进行部署的示例。特征 用TypeScript编写的无服务器功能 在Vercel上针对主分支和请求请求进行部署 使用Jest测试支持 使用...
本文将介绍如何使用TypeScript和Angular框架构建Web组件。在展开具体知识点之前,我们首先要了解一下TypeScript和Angular的基本概念以及Web组件的相关历史。 1. JavaScript的发展历史:TypeScript是JavaScript的一...
ORM for TypeScript and JavaScr
无服务器分析 :high_voltage: 一个Google Analytics(分析)个人跟踪网站访问者的示例项目和概念验证。 您可以在上了解有关进行更多信息… ...可以在serverless.yml配置文件中自定义所有设置。 您可以轻松更改Dyn
Building Web Components with TypeScript and Angular 4 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
在本地运行API网关使用serverless offline start 支持单元测试运行npm test以运行测试 正确错误消息的源映射 错误消息显示正确的行号 使用CloudWatch进行生产 使用ESLint整理代码 为您的阶段添加环境变量 无需管理...
Advanced TypeScript Programming Projects: Build 9 different apps with TypeScript 3 and JavaScript frameworks such as Angular, React, and Vue Gain in-depth knowledge of TypeScript and the latest ...
【标题】:“serverless-typescript-starter”是一个用于创建无服务器功能的项目模板,它特别强调了使用TypeScript作为开发语言。无服务器架构是一种云计算模型,开发者只需关注业务逻辑,而无需关心底层基础设施的...
Introducing Regular Expressions JavaScript and TypeScript 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
2021年3月,TypeScript发布了自己的最新版本手册。该手册是学习 TypeScript 语言及其常用用法的主要资源。官方人员指出,新手册在 TypeScript 团队中已经是一个运行多年的项目,包含了大大小小的数百个贡献。 这项...
Explore the features of this innovative open source language in depth, from working with the type system through object-orientation to understanding the runtime and the TypeScript compiler. This fully...
根据提供的文件内容,下面我将详细总结关于TypeScript的知识点。 首先,TypeScript是一种由Microsoft开发的编程语言,它在JavaScript的基础上扩展了类型系统,提供了更多的结构化特性和ES6的支持。由于它能够编译成...