serverless-webpack icon indicating copy to clipboard operation
serverless-webpack copied to clipboard

Typescript Example Fails to Deploy

Open davidfells opened this issue 4 years ago • 1 comments

This is a Bug Report

I ran into a strange issue trying to use serverless-webpack on my project and in the process of troubleshooting, tried running the TS example here.

Description

For bug reports:

  • What went wrong? Deploy Fails
  • What did you expect should have happened? Deploy Succeeds
  • What was the config you used? Default TS example
  • What stacktrace or error message from your provider did you see?

sls deploy Serverless: Bundling with Webpack... Starting type checking service... Using 1 worker with 2048MB memory limit Starting type checking service... Using 1 worker with 2048MB memory limit internal/modules/cjs/loader.js:983 throw err; ^

Error: Cannot find module '/Users/davidfells/Projects/serverless-webpack/examples/typescript/--max-old-space-size=2048' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } internal/modules/cjs/loader.js:983 throw err; ^

Error: Cannot find module '/Users/davidfells/Projects/serverless-webpack/examples/typescript/--max-old-space-size=2048' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Additional Data

  • Serverless-Webpack Version you're using: TS example
  • Webpack version you're using: TS example
  • Serverless Framework Version you're using: TS example
  • Operating System: Mac OS Mojave
  • Stack Trace (if available):

davidfells avatar May 13 '20 05:05 davidfells

I've just ran into the same problem and it seems to be caused by fork-ts-checker-webpack-plugin in production mode. That's also probably the reason why it's commented out in the TS example :) Here's a related issue: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/406.

pheekus avatar May 16 '20 14:05 pheekus