bhall2001 / serverless-nextjs-github-ci-cd

How to use Github actions to manage the CI/CD flow of a serverless-nextjs project.
MIT License
79 stars 11 forks source link

serverless remove Error: Cannot find module #2

Closed damo78 closed 3 years ago

damo78 commented 3 years ago

Hi Bob

I hope this is the best way to ask this question. I was partly following your guide but using GitLab CI. Have you tried using serverless remove in your example project (or other) and does it work?

I am able to use the remote S3 state for deploying, updating etc., but when it comes to removing I get the issue this issue, which I've logged against the serverless next repo.

It essentially says Error: Cannot find module '/root/.serverless/components/registry/npm/@sls-next/serverless-component@1.18.0-alpha.18/node_modules/@sls-next/serverless-component'

There wasn't anything in your README about it so thought I'd see if it is something you've tried.

Thanks

bhall2001 commented 3 years ago

Removing does not work and it is an issue with serverless nextjs. I find I need to manually go to aws and remove the Cloudfront config related to the deployed nextjs code. Once Cloudfront finishes (usually about 15 minutes), I then manually remove the lambda's related to the deployment.

I will update the README to include this issue. Thanks for pointing this out!

damo78 commented 3 years ago

Many thanks. I thought I was going mad

It seems deploy no longer works now either. Similar sort of error. I’ve literally had to start again from scratch on my pipeline to see what’s changed and it seems no matter how far I go back, what version, or start again, the component no longer works on gitlab ci. It’s also happening for someone else who’s replied to my issue (above)

Is your deploy still working?

bhall2001 commented 3 years ago

The deploy is broken because severless-nextjs moved the repo. I'm working on it now. https://github.com/bhall2001/serverless-nextjs-github-ci-cd/issues/3

bhall2001 commented 3 years ago

I've updated the README to include instructions on how to remove. If you executed the remove command, then you will need to manually remove the CloudFront distribution and lambda function(s) or you will not be able to deploy. You will need to backtrack to the "initial deploy" step being sure to comment out the s3 download before the first deploy.