anomalyinnovations / serverless-typescript-starter Goto Github PK
View Code? Open in Web Editor NEWA Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.
License: MIT License
A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.
License: MIT License
Hi, i've clone this repository through serverless install, i've follow the instruction
npm install
and tried run it but nothing work
internal/modules/cjs/loader.js:967
throw err;
^
Error: Cannot find module '/Users/kelvindesman/apps/startup/knowid-backend/--max-old-space-size=2048'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:964:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
This sample is a bit dated and not up to date with latest version of serverless-bundle.
Hello! I'm trying to use serverless-bundle for typescript in my project. I cloned the typescript starter project. This project is part of a workspace, and it extends a base tsconfig.
I can run tsc
just fine, but when I try to invoke a serverless function or start the server, I get a cryptic error that I've been trying to fix for hours now:
sls invoke local --function hello
serverless-bundle: CommonJS, ES3, or ES5 are not supported
Serverless: Bundling with Webpack...
ERROR in /Users/{user}/work/next/packages/cloud/lincoln/new-new-api/src/handler.ts
Module build failed (from /Users/{user}/work/next/node_modules/ts-loader/index.js):
TypeError: Cannot read property 'tap' of undefined
at makeAssetsCallback (/Users/{user}/work/next/node_modules/ts-loader/dist/instances.js:218:50)
at addAssetHooks (/Users/{user}/work/next/node_modules/ts-loader/dist/instances.js:224:9)
at Object.initializeInstance (/Users/{user}/work/next/node_modules/ts-loader/dist/instances.js:266:13)
at successLoader (/Users/{user}/work/next/node_modules/ts-loader/dist/index.js:26:17)
at Object.loader (/Users/{user}/work/next/node_modules/ts-loader/dist/index.js:23:5)
Error ---------------------------------------------------
Error: Webpack compilation error, see stats above
at /Users/{user}/work/next/node_modules/serverless-bundle/node_modules/serverless-webpack/lib/compile.js:32:15
I can find no leads in debugging as to what I need to fix. Any suggestions? I dug into node_modules and the undefined object attempting to access a .tap function is compilation.hooks.afterProcessAssets
.
is there any way to build minified bundle
{
"serverless-bundle": "^3.2.1",
}
I'm trying to debug this template using vscode and the vscode-jest-runner extension. I can run the initial test successfully but when I try to debug the test I receive the following error:
SyntaxError: /.../tests/handler.test.ts: Unexpected token, expected ";" (5:38)
3 |
4 | test("hello", async () => {
> 5 | const event = { body: "Test Body" } as APIGatewayEvent;
To summarize:
serverless-bundle test
commandAny idea why this might be happening or how I can resolve it? It seems like the run and debug are using different jest
s or something like that.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.