question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot deploy with nestjs (but sls offline works)

See original GitHub issue
ERROR in /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-application.js
Module not found: Error: Can't resolve '@nestjs/microservices' in '/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core'
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-application.js 112:115-147
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/index.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/g11n-service/src/lambda.ts

ERROR in /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-factory.js
Module not found: Error: Can't resolve '@nestjs/microservices' in '/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core'
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-factory.js 49:115-147
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/index.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/g11n-service/src/lambda.ts

ERROR in /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-application.js
Module not found: Error: Can't resolve '@nestjs/microservices/microservices-module' in '/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core'
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-application.js 17:120-173
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/index.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/g11n-service/src/lambda.ts

ERROR in /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-application.js
Module not found: Error: Can't resolve '@nestjs/websockets/socket-module' in '/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core'
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/nest-application.js 16:102-145
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/core/index.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/g11n-service/src/lambda.ts

ERROR in /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/common/cache/cache.providers.js
Module not found: Error: Can't resolve 'cache-manager' in '/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/common/cache'
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/common/cache/cache.providers.js 16:103-127
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/common/cache/cache.module.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/common/cache/index.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/@nestjs/common/index.js
 @ /Users/softmarshmallow/Documents/Apps/bridged/services/g11n-service/src/lambda.ts
 
  Error --------------------------------------------------
 
  Error: Webpack compilation error, see above
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/serverless-webpack/lib/compile.js:36:17
      at arrayEach (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/lodash/lodash.js:516:11)
      at Function.forEach (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/lodash/lodash.js:9368:14)
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/serverless-webpack/lib/compile.js:29:9
      at finalCallback (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/MultiCompiler.js:254:12)
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/MultiCompiler.js:277:6
      at done (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/neo-async/async.js:2931:13)
      at runCompilers (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/MultiCompiler.js:181:48)
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/MultiCompiler.js:188:7
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/MultiCompiler.js:270:7
      at finalCallback (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/Compiler.js:257:39)
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/Compiler.js:273:13
      at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
      at AsyncSeriesHook.lazyCompileHook (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/tapable/lib/Hook.js:154:20)
      at onCompiled (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/Compiler.js:271:21)
      at /Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/webpack/lib/Compiler.js:681:15
      at eval (eval at create (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:521:22)
      at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:541:17)
      at ServerlessPlugin.<anonymous> (/Users/softmarshmallow/Documents/Apps/bridged/services/node_modules/serverless-webpack/index.js:94:53)
      at processImmediate (internal/timers.js:456:21)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.18.3
     Framework Version:         2.15.0
     Plugin Version:            4.2.0
     SDK Version:               2.3.2
     Components Version:        3.4.3

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
PenguinOfWarcommented, Dec 18, 2020
    forceExclude:
      - '@nestjs/microservices'
      - '@nestjs/microservices/microservices-module'
      - '@nestjs/websockets/socket-module'
      - 'cache-manager'

this does the trick, but is this the right/ onlu solution?

This looks correct to me. Does the deployed cloud function perform as expected?

0reactions
softmarshmallowcommented, Dec 21, 2021

I’m using this combination for production. I’ll share the solution shortly when i get some freetime

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless is unable to find the handler in nestjs
I am trying to deploy my NestJS project to AWS lambda with ... When I run sls offline , it successfull runs and...
Read more >
One of the module nesting for handler is undefined #1377
I'm currently deploying a Remix app with serverless and using serverless-offline to run my app on development environment (highly inspired by @ ...
Read more >
Serverless - FAQ | NestJS - A progressive Node.js framework
Hint To speed up development cycles, we install the serverless-offline plugin which emulates AWS λ and API Gateway. Once the installation process is...
Read more >
Serverless Offline - Serverless Framework: Plugins
npm install serverless-offline --save-dev ... serverless offline or sls offline . ... But if you send an application/x-www-form-urlencoded or a ...
Read more >
Deploy a NestJS App with Serverless Framework - Theodo blog
Here in Theodo we are very enthusiastic about NestJS framework. It is quite young but we consider it currently one of the best...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found