Frequently Asked Questions

This is a list of frequently asked questions related to local development with Now.

All of the questions feature full answers and many contain links to other resources you may find helpful.

Questions can be found under their relevant section header.

Now + Next.js

Why use now dev when developing a Next.js app? Why not just run next dev?

When you are developing a Next.js application for Now 2.0, the main objective with now dev is to imitate our cloud environment.

With that in mind, a few additional steps are necessary before your application can be served in a Serverless environment, including the execution of Builders to optimize your code, proper handling of routes defined in your now.json and the loading of environment variables. now dev is a single command development experience.

Supported Builders

Which Builders are supported in now dev?

The following Builders are currently supported for use within now dev:

The following Builders are not yet supported but are being worked on and should be available soon:

Third-party Builders

Does now dev work with builders that are not in the official list?

While we strongly recommend using our Official Builders, other Builders should work too.

The Official Builders contain optimizations and features specifically aligned with the current release of now dev. If your specific use-case isn't working out, please don't hesitate to reach out to us on our community chat — we'll try our best to help.

Upgrading

How do I upgrade to now dev?

Get started by downloading the Now CLI or upgrade your existing installation to use now dev.

We always recommend running the latest version of the Now CLI. This lets you take advantage of the newest features, stability and security enhancements. To download the Now CLI, visit our download page. To upgrade the Now CLI, follow the instructions in the Upgrade section.

I've used Now 1.0 in the past, how do I start using now dev?

We encourage you to upgrade to Now 2.0 in order to take advantage of now dev. Upgrading also allows you to enjoy new features, better performance and security, and lower pricing.

Once complete, you can start refactoring your now.json. In Now 2.0 we've introduced 2 new configurations:

  • builds: This is responsible to translate your code into one or more lambdas or static assets. The documentation can be accessed here.
  • routes: By default, the filesystem is used as a router. You can manipulate that behavior with this configuration. The documentation can be accessed here.

A look at our examples is also recommended, since it is very likely that you can borrow a now.json and deploy your app quicker.

Environment Variables and Secrets

Why am I seeing an environment variables are not defined in .env error when using secrets?

now dev does not currently support the use of secrets defined in the Now CLI. To use environment variables with now dev, create a .env file and add them there as suggested in our documentation.

Why I can’t use .env or .env.build when deploying?

Your application's security is of paramount importance to us. An unencrypted .env file exposes you to a security risk — therefore we do not allow it. Use the secrets feature to protect your information by storing your variables safely in the cloud.

How do I detect local development or cloud deployment?

Sometimes you need to execute a different code path when your application is running locally compared to when it is running remotely in the cloud. All deployments expose a NOW_REGION environment variable which is assigned to the region where the Lambda is currently executing. This value is dev1 for local development.

Types of Projects

Does now dev work for all types of projects?

Yes! now dev works for all types of projects using the Official Builders that can be deployed to Now.

Developing Offline

Why doesn’t now dev work offline for me?

now dev needs to be able to download your project's dependencies before it can continue. If you aren't able to use now dev offline, most likely your dependencies haven't been downloaded yet — getting online and running now dev again should fix it.

Getting Help

Something isn’t right with now dev – who do I reach out to?

Firstly, make sure your Now CLI is up-to-date. If upgrading doesn't fix it for you, you're welcome to ask in our community chat for help, or you can create a new issue in the now-cli repository.

Someone from the ZEIT team or an experienced member of the community will assist you. For dedicated support learn more about how to extend your ZEIT experience and view our plan add-ons.

Read More

Extend your projects with all that Now offers: