GithubHelp home page GithubHelp logo

anomalyinnovations / serverless-typescript-starter Goto Github PK

View Code? Open in Web Editor NEW
79.0 79.0 21.0 142 KB

A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.

License: MIT License

TypeScript 100.00%
jest serverless serverless-bundle serverless-framework serverless-offline typescript

serverless-typescript-starter's People

Contributors

jayair avatar kilakewe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

serverless-typescript-starter's Issues

Issue running & deploying

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: []

Project is outdated

This sample is a bit dated and not up to date with latest version of serverless-bundle.

Webpack Error: "Cannot read property 'tap' of undefined"

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.

minified build

is there any way to build minified bundle

{
   "serverless-bundle": "^3.2.1",
}

Debugging in vscode with Jest Runner

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:

Any idea why this might be happening or how I can resolve it? It seems like the run and debug are using different jests or something like that.

Thanks.

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.