Started getting the Error: Cannot find module '@sls-next/next-aws-cloudfront'
See original GitHub issueDescribe the bug My deployments have been working well on AWS being ran by code build. Today I suddenly got an error for my builds on two separate AWS instances with the error:
{ Error: Cannot find module '@sls-next/next-aws-cloudfront'
--
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.resolve (internal/modules/cjs/helpers.js:33:19)
at Builder.<anonymous> (/root/.serverless/components/registry/npm/serverless-next.js@1.15.0-alpha.2/node_modules/@sls-next/lambda-at-edge/dist/build.js:119:49)
at Generator.next (<anonymous>)
at /root/.serverless/components/registry/npm/serverless-next.js@1.15.0-alpha.2/node_modules/@sls-next/lambda-at-edge/dist/build.js:8:71
at new Promise (<anonymous>)
at __awaiter (/root/.serverless/components/registry/npm/serverless-next.js@1.15.0-alpha.2/node_modules/@sls-next/lambda-at-edge/dist/build.js:4:12)
at Builder.buildDefaultLambda (/root/.serverless/components/registry/npm/serverless-next.js@1.15.0-alpha.2/node_modules/@sls-next/lambda-at-edge/dist/build.js:98:16)
at Builder.<anonymous> (/root/.serverless/components/registry/npm/serverless-next.js@1.15.0-alpha.2/node_modules/@sls-next/lambda-at-edge/dist/build.js:266:24)
at Generator.next (<anonymous>) code: 'MODULE_NOT_FOUND' }
·[G·[?25h·[G·[J
64s › myApp › Error: Cannot find module '@sls-next/next-aws-cloudfront'
Expected behaviour Ideally the deployment should give a success and output the cloudfront link.
Additional context I haven’t had any package related issue with the package and I’m running using the following in my package JSON.
"serverless": "^1.67.0",
"serverless-next.js": "^1.9.5",
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:17 (6 by maintainers)
Top Results From Across the Web
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
I'm getting the error because I'm trying to import the freeCodeCamp icon from the react-icons package, which I don't have installed. import { ......
Read more >Error: Cannot find module 'default-browser-id' in v.6.5.2 #18268
But just running to start-storybook in v6.5.2 should reproduce this error, I assume. System. Environment Info: System: OS: macOS 12.4 CPU: (8) ...
Read more >ServiceNow Community servicenow community
I am trying to setup the CLI for component development and get the infamous error "keytar module" not found. Can someone tell me...
Read more >How to resolve "Cannot find module" error in Node - Sabe.io
When you are working in Node, you will sometimes encounter the error Cannot find module 'module-name' with the error code MODULE_NOT_FOUND .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi folks, please pin the version number in your
serverless.yml
like it states in the README. For example:Thank you @danielcondemarin , it worked nicely after deleting existing cloudfront distribution and lambdas.
and my lambdas are named properly now. 🎉🎉🎉