serverless-next.js | ⚡ Deploy your Next.js apps | Cloud Functions library

 by   serverless-nextjs TypeScript Version: v3.8.0-alpha.0 License: MIT

kandi X-RAY | serverless-next.js Summary

kandi X-RAY | serverless-next.js Summary

serverless-next.js is a TypeScript library typically used in Serverless, Cloud Functions applications. serverless-next.js has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

A zero configuration Next.js 10/11 serverless component for AWS Lambda@Edge aiming for full feature parity. Please review features for a list of currently supported features.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              serverless-next.js has a medium active ecosystem.
              It has 4168 star(s) with 452 fork(s). There are 31 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 212 open issues and 704 have been closed. On average issues are closed in 47 days. There are 103 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of serverless-next.js is v3.8.0-alpha.0

            kandi-Quality Quality

              serverless-next.js has no bugs reported.

            kandi-Security Security

              serverless-next.js has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              serverless-next.js is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              serverless-next.js releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of serverless-next.js
            Get all kandi verified functions for this library.

            serverless-next.js Key Features

            No Key Features are available at this moment for serverless-next.js.

            serverless-next.js Examples and Code Snippets

            No Code Snippets are available at this moment for serverless-next.js.

            Community Discussions

            QUESTION

            How do I target the same instance when deploying using Serverless Components?
            Asked 2021-Mar-23 at 19:47

            My team and I are using Serverless Components (for NextJS - https://github.com/serverless-nextjs/serverless-next.js) and it works great, except...

            Every time one of us deploys, we seem to create a whole new instance on the AWS account. Is there a way to target the same instance? Or do I need to just manually set every ARN for every role, Lambda, etc?

            ...

            ANSWER

            Answered 2021-Mar-23 at 19:47

            Per https://github.com/serverless-nextjs/serverless-next.js/issues/962#issuecomment-805185061

            You need to find a way to share your .serverless dir. If you only have one environment then you can add the directory to git. Otherwise search for "Multi-stage deployments" in the repo for some suggestions.

            Source https://stackoverflow.com/questions/66767651

            QUESTION

            How to connect to AWS ElastiCache Cluster from AWS CloudFront using Node.js?
            Asked 2021-Jan-09 at 06:13

            I am new to AWS CloudFront and AWS in general. I have a Next.js (React SSR framework) website which I deployed onto AWS using serverless-nextjs (https://github.com/serverless-nextjs/serverless-next.js). However, I also need some sort of caching for my web app. I decided to use redis ElastiCache from AWS. I created an redis ElastiCache Cluster on the AWS console.

            My attempt:

            I setup the code for connecting to the redis ElastiCache like this:

            ...

            ANSWER

            Answered 2021-Jan-09 at 06:13

            You can't connect to ES from outside (i.e. your local workstation) of AWS directly. ES domains are designed to be only accessible from within your resources (e.g. instances) in the same VPC as your ES domain. From docs:

            Elasticache is a service designed to be used internally to your VPC. External access is discouraged due to the latency of Internet traffic and security concerns. However, if external access to Elasticache is required for test or development purposes, it can be done through a VPN.

            The only way to enable connections from outside AWS to your ES is if you establish a VPN connection between home/work network or Direct Connect as explained in AWS docs:

            This scenario is also supported providing there is connectivity between the customers’ VPC and the data center either through VPN or Direct Connect.

            However, for quick, ad-hock setup you can use ssh tunnel between your local workstation and ES domain. This will require some jump/basion EC2 instance which the tunnel will go through.

            Source https://stackoverflow.com/questions/65638520

            QUESTION

            AWS Lambda next.js - Failed to post 2MB file to api route
            Asked 2020-Nov-18 at 21:16

            I deployed my next.js app to aws usingserverless-next.js package. When I'm trying to post a big file (~1MB) to the api route, I'm getting a 503 response code. The full response content:

            ...

            ANSWER

            Answered 2020-Nov-18 at 21:16

            It's written here: https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html

            You can't have a request + response larger than 256 KB if you upload in asynchronous mode.

            Because serverless is only here to make your routes in lambda functions. If you want to upload this file, you can use S3 bucket with pre-signed url. With that you doesn't need to upload the file to the lambda function.

            Source https://stackoverflow.com/questions/64901128

            QUESTION

            Request to /api folder from getInitialProps
            Asked 2020-Oct-25 at 15:49

            In my app, I'm sending request from getInitialProps to an api endpoint (in /api folder). When running my app in localhost, everything works, because it's all under same domain (localhost).

            After deploying my app successfully to aws lambda (using serverless-next.js), those requests doesn't work anymore.
            The reason is that the host header when running getInitialProps in server, is myAppBucket.s3.us-east-1.amazonaws.com, but the app domain is https://d25q7fh11ll2cg.cloudfront.net. request to myAppBucket.s3.us-east-1.amazonaws.com/api/users doesn't work but to https://d25q7fh11ll2cg.cloudfront.net/api/users works. But I don't have the domain data (i.e https://d25q7fh11ll2cg.cloudfront.net/api/users) when running getInitialProps.

            I don't want to put the domain as an env var. there is another solution for this? Also, calling directly the handler function from getInitialProps is problematic because the handler use a server-side only packages. Thanks

            ...

            ANSWER

            Answered 2020-Oct-25 at 15:49

            I meet a similar use case with you.

            First, I suggest you to replace getInitialProps by getServerSideProps or getStaticProps to make sure you call your API from server side.

            getInitialProps is deprecated, and they may run at client or server side, so they may cause unexpected behavior for your use case (our api route is server side)

            Then from Next.js docs (https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering or https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation), check their small grey box:

            Source https://stackoverflow.com/questions/64518020

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install serverless-next.js

            First, ensure you have Node.js 12+ installed on the deploying machine as all code is now transpiled to ES2019. Add your next application to the serverless.yml:. :no_entry_sign: If you specify @sls-next/serverless-component in your serverless.yml file, do not add @sls-next/serverless-component to your package.json file, it is not used and only the version in serverless.yml file is used, which Serverless pulls from npm by itself. If you do not specify the version, it will use the latest tag, which refers to the latest stable version here (i.e not alpha versions). You can also point it to a local installation, for example if you want to version using package.json.

            Support

            You can open a new issue here. If posting a problem, please follow the debugging wiki first for some useful tips, and try to include as much information to reproduce the issue. If you are reporting a security vulnerability, please follow the security policy instead. Please note that there is only one core maintainer right now (@dphang), and a handful of community contributors, who all contribute to this library in their free time. So we hope you understand that our response is best-effort and may take several days, or more. So we hope you could at least help debug the issue or provide as much context. In case an issue hasn't been looked at for a long time (> a few weeks) or it seems like a major issue, feel free to mention a maintainer and we will try to prioritize it.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/serverless-nextjs/serverless-next.js.git

          • CLI

            gh repo clone serverless-nextjs/serverless-next.js

          • sshUrl

            git@github.com:serverless-nextjs/serverless-next.js.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Cloud Functions Libraries