Giter Site home page Giter Site logo

vercel / vercel Goto Github PK

View Code? Open in Web Editor NEW
12.2K 185.0 2.1K 132.63 MB

Develop. Preview. Ship.

Home Page: https://vercel.com

License: Apache License 2.0

JavaScript 20.59% TypeScript 73.16% Go 0.18% Python 0.37% Ruby 0.08% EJS 0.62% HTML 1.95% CSS 1.66% Shell 0.01% Vue 0.42% Stylus 0.71% Svelte 0.03% Marko 0.20% Riot 0.03% Handlebars 0.01% MDX 0.01%
cli command vercel cloud hosting jamstack ship

vercel's Introduction

Vercel

Develop. Preview. Ship.

Documentation · Changelog · Templates · CLI


Vercel

Vercel’s Frontend Cloud provides the developer experience and infrastructure to build, scale, and secure a faster, more personalized Web.

Deploy

Get started by importing a project or using the Vercel CLI. Then, git push to deploy.

Documentation

For details on how to use Vercel, check out our documentation.

Contributing

This project uses pnpm to install dependencies and run scripts.

You can use the dev script to run local changes as if you were invoking Vercel CLI. For example, vercel deploy --cwd=/path/to/project could be run with local changes with pnpm dev deploy --cwd=/path/to/project.

When contributing to this repository, please first discuss the change you wish to make via GitHub Discussions with the owners of this repository before submitting a Pull Request.

Please read our Code of Conduct and follow it in all your interactions with the project.

Local development

This project is configured in a monorepo, where one repository contains multiple npm packages. Dependencies are installed and managed with pnpm, not npm CLI.

To get started, execute the following:

git clone https://github.com/vercel/vercel
cd vercel
corepack enable
pnpm install
pnpm build
pnpm lint
pnpm test-unit

Make sure all the tests pass before making changes.

Running Vercel CLI Changes

You can use pnpm dev from the cli package to invoke Vercel CLI with local changes:

cd ./packages/cli
pnpm dev <cli-commands...>

See CLI Local Development for more details.

Verifying your change

Once you are done with your changes (we even suggest doing it along the way), make sure all the tests still pass by running:

pnpm test-unit

from the root of the project.

If any test fails, make sure to fix it along with your changes. See Interpreting test errors for more information about how the tests are executed, especially the integration tests.

Pull Request Process

Once you are confident that your changes work properly, open a pull request on the main repository.

The pull request will be reviewed by the maintainers and the tests will be checked by our continuous integration platform.

Interpreting test errors

There are 2 kinds of tests in this repository – Unit tests and Integration tests.

Unit tests are run locally with jest and execute quickly because they are testing the smallest units of code.

Integration tests

Integration tests create deployments to your Vercel account using the test project name. After each test is deployed, the probes key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:

[Error: Fetched page https://test-8ashcdlew.vercel.app/root.js does not contain hello Root!. Instead it contains An error occurred with this application.

    NO_STATUS_CODE_FRO Response headers:
       cache-control=s-maxage=0
      connection=close
      content-type=text/plain; charset=utf-8
      date=Wed, 19 Jun 2019 18:01:37 GMT
      server=now
      strict-transport-security=max-age=63072000
      transfer-encoding=chunked
      x-now-id=iad1:hgtzj-1560967297876-44ae12559f95
      x-now-trace=iad1]

In such cases, you can visit the URL of the failed deployment and append /_logs to see the build error. In the case above, that would be https://test-8ashcdlew.vercel.app/_logs

The logs of this deployment will contain the actual error which may help you to understand what went wrong.

Running integration tests locally

While running the full integration suite locally is not recommended, it's sometimes useful to isolate a failing test by running it on your machine. To do so, you'll need to ensure you have the appropriate credentials sourced in your shell:

  1. Create an access token. Follow the insructions here https://vercel.com/docs/rest-api#creating-an-access-token. Ensure the token scope is for your personal account.
  2. Grab the team ID from the Vercel dashboard at https://vercel.com/<MY-TEAM>/~/settings.
  3. Source these into your shell rc file: echo 'export VERCEL_TOKEN=<MY-TOKEN> VERCEL_TEAM_ID=<MY-TEAM-ID>' >> ~/.zshrc

From there, you should be able to trigger an integration test. Choose one that's already isolated to check that things work:

cd packages/next

Run the test:

pnpm test test/fixtures/00-server-build/index.test.js

@vercel/nft

Some of the Builders use @vercel/nft to tree-shake files before deployment. If you suspect an error with this tree-shaking mechanism, you can create the following script in your project:

const { nodeFileTrace } = require('@vercel/nft');
nodeFileTrace(['path/to/entrypoint.js'], {
  ts: true,
  mixedModules: true,
})
  .then(o => console.log(o.fileList))
  .then(e => console.error(e));

When you run this script, you'll see all the imported files. If anything file is missing, the bug is in @vercel/nft and not the Builder.

Deploy a Builder with existing project

Sometimes you want to test changes to a Builder against an existing project, maybe with vercel dev or actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.

  1. Change directory to the desired Builder cd ./packages/node
  2. Run pnpm build to compile typescript and other build steps
  3. Run npm pack to create a tarball file
  4. Run vercel *.tgz to upload the tarball file and get a URL
  5. Edit any existing vercel.json project and replace use with the URL
  6. Run vercel or vercel dev to deploy with the experimental Builder

Reference

vercel's People

Contributors

amio avatar andybitz avatar dependabot[bot] avatar endangeredmassa avatar ethan-arrowood avatar greenkeeper[bot] avatar greenkeeperio-bot avatar igorklopov avatar ijjk avatar jamo avatar javivelasco avatar juliangruber avatar leerob avatar leo avatar lucleray avatar matheuss avatar matthewstanciu avatar mglagola avatar nkzawa avatar olliv avatar pranaygp avatar rauchg avatar rdev avatar styfle avatar thasophearak avatar timer avatar timneutkens avatar tootallnate avatar trek avatar vercel-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vercel's Issues

Not all NPM scripts are executed during deployment

According to the NPM docs prepublish script should be executed on local npm install without any arguments. It seems that on Now it is not the case.

I depend on this to compile my sources (e.g. coffee, elm -> js).

Consider this sample package to test scripts execution. This is the output on my local machine:

$ npm install

> [email protected] preinstall /Users/tadeuszlazurski/Projects/npm-scripts
> echo 'NPM SCRIPT: preinstall'

NPM SCRIPT: preinstall
|
> [email protected] install /Users/tadeuszlazurski/Projects/npm-scripts
> echo 'NPM SCRIPT: install'

NPM SCRIPT: install

> [email protected] postinstall /Users/tadeuszlazurski/Projects/npm-scripts
> echo 'NPM SCRIPT: postinstall'

NPM SCRIPT: postinstall

> [email protected] prepublish /Users/tadeuszlazurski/Projects/npm-scripts
> echo 'NPM SCRIPT: prepublish'

NPM SCRIPT: prepublish
[email protected] node_modules/coffee-script

[email protected] node_modules/lodash

and this is output from now:

 $ now
> Deploying ~/Projects/npm-scripts
> Using Node.js 6.2.1 (default)
> Ready! https://npm-scripts-izbtgitqee.now.sh (copied to clipboard) [3s]
> Upload [====================] 100% 0.0s
> Sync complete (25.9kB) [3s]
> Initializing…
> Building
> ▲ npm install
> Installing package lodash@^3.10.1
> Installing package coffee-script@^1.9.3
> ▲ npm start
> NPM SCRIPT: prestart
> NPM SCRIPT: start
> NPM SCRIPT: poststart
> start exited with status 0

As you can see none of the following scripts:

  • preinstall
  • install
  • postinstall
  • prepublish

was executed in Now.

@lzrski

now's npm install excludes devDependencies

Not sure if I missed this somewhere, but now seems to not install devDependencies when deploying. My build script uses webpack, which is defined as a devDependency, so it can't find it. Is this supported? Do I need to list all dependencies as regular dependencies?

Improve confirmation prompt

It should specifically buffer and wait for \n in all cases. Right now it's hit and miss and arbitrary, based on the data event alone.

Loading indicator on landing page, overflow + scroll

Sorry, this one is super-tiny, but I noticed it and just wanted to document in case it was a detail someone wanted to update.

The combination of the default browser style for Chrome (51):

body {
    margin: 8px;
}

and the "Loading..." element with

width: 100%

... breaks the box model, with a 16px overflow, horizontally. The fix would be to reset the <body> margin to 0, or update the absolute positioning of the loading element:

// width: 100%;
left: 0;
right: 0;

@bpartridge83

Alias option for deploy

It would be great to be able to specify the alias to use with the now deploy command. @rauchg indicated that this would be supported with a command line option. Any idea when this will be available?

@aexmachina

git based dependencies doesn't work

Example deploy: https://code-flow-svuzhcsykp.now.sh/

The problem is that image-to-ascii contains a git based dependency, which now can't install, and throws an UnhandledPromiseRejectionWarning from a `404 (see logs in URL above).

This is the dep tree:

├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ ├─┬ [email protected]
│ │   │ │ ├── [email protected] (git://github.com/chalk/ansi-styles.git#5dadc5c6333127f95dc0dc09ada4fbde8bf66e69)

I tried to make [email protected] a direct dependency of my project to allow the code to still run, but the failed install process doesn't allow my project to start, so I can't work around the issue. Essentially the 404 is a total blocker for using this image-to-ascii project (pending a PR to it's repo!).

For reference, since the source doesn't work on the deployment (not sure why), here's the package.json dependencies:

"dependencies": {
  "ansi-styles": "^2.1.0",
  "busboy": "^0.2.13",
  "express": "^4.14.0",
  "image-to-ascii": "^3.0.3",
  "multer": "^1.2.0"
}

Aliasing a `now-serve` deployment to custom domain

Hopefully I just have a bad dependency somewhere.

Note that the domain I'm trying this with is a .bm (Bermuda) domain name, not sure if that matters but it's definitely not common.

Deployment ID and domain truncated and replaced, respectively, for privacy.

$ now alias wKUr5n example.bm --debug

> [debug] Checking for updates.
> [debug] Up to date (0.25.0).
> [debug] /list: 703.425ms
> [debug] matched deployment wKUr5n by uid wKUr5n
> example.bm is a custom domain.
> Verifying the DNS settings for example.bm (see https://zeit.world for help)
> [debug] #1 GET /whois-ns: 287.395ms
> [debug] Retrying: Error: Whois error (500): An unexpected internal error occurred
    at Alias._callee11$ (/usr/local/lib/node_modules/now/build/lib/index.js:900:27)
    at tryCatch (/usr/local/lib/node_modules/now/node_modules/babel-runtime/regenerator/runtime.js:88:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/now/node_modules/babel-runtime/regenerator/runtime.js:341:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/now/node_modules/babel-runtime/regenerator/runtime.js:121:21)
    at step (/usr/local/lib/node_modules/now/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/local/lib/node_modules/now/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at run (/usr/local/lib/node_modules/now/node_modules/core-js/library/modules/es6.promise.js:108:47)
    at /usr/local/lib/node_modules/now/node_modules/core-js/library/modules/es6.promise.js:119:28
    at flush (/usr/local/lib/node_modules/now/node_modules/core-js/library/modules/$.microtask.js:19:5)
    at nextTickCallbackWith0Args (node.js:433:9)
> [debug] #2 GET /whois-ns: 84.056ms
> [debug] Retrying: Error: Whois error (500): An unexpected internal error occurred
    at Alias._callee11$ (/usr/local/lib/node_modules/now/build/lib/index.js:900:27)
    at tryCatch (/usr/local/lib/node_modules/now/node_modules/babel-runtime/regenerator/runtime.js:88:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/now/node_modules/babel-runtime/regenerator/runtime.js:341:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/now/node_modules/babel-runtime/regenerator/runtime.js:121:21)
    at step (/usr/local/lib/node_modules/now/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/local/lib/node_modules/now/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at run (/usr/local/lib/node_modules/now/node_modules/core-js/library/modules/es6.promise.js:108:47)
    at /usr/local/lib/node_modules/now/node_modules/core-js/library/modules/es6.promise.js:119:28
    at flush (/usr/local/lib/node_modules/now/node_modules/core-js/library/modules/$.microtask.js:19:5)
    at nextTickCallbackWith0Args (node.js:433:9)
> [debug] Retrying: FetchError: request to https://api.zeit.co/whois-ns-fallback?domain=example.bm failed, reason: socket hang up
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/now/node_modules/node-fetch/index.js:127:11)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketErrorListener (_http_client.js:265:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Stream.onStreamError (/usr/local/lib/node_modules/now/node_modules/spdy/lib/spdy/handle.js:89:18)
    at emitOne (events.js:77:13)
    at Stream.emit (events.js:169:7)
    at /usr/local/lib/node_modules/now/node_modules/spdy-transport/lib/spdy-transport/connection.js:752:12

Progress bar improvements

  • Make sure progress bar renders at the beginning. When uploading a single large file it's not showing!
  • Make sure progress bar tracks total size, not total files, and that each progress event updates it
  • Make sure we debounce it to avoid a performance degradation from frequent repainting

Create React App

I am not sure if this should be possible at all but I will leave it here anyways:

After deploying an app that was created with create rect app I am getting this warning:
> (node:310) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3
And in the browser:

Failed to compile.

Error in ./src/index.js
Module build failed: Error: EACCES: permission denied, mkdir '/home/nowuser/src/node_modules/.cache'
    at Error (native)
 @ multi main

Tables look gross

  • We should make sure the columns are aligned across apps (now ls, now alias ls)
  • We should think about adding headers for extra clarity
  • We should remove the extra \n in now alias ls

Ensure consistent `usage` error style

Some commands display an error followed by the help message when using a sub-command wrong, and others just display the error.

We should switch to a hybrid, where we say:

> Error! Incorrect number of parameters supplied
> Usage: now alias add <from> <to>
> For further help and examples, run `now help alias`

npm errors when deploying with react-snapshot dependency

I have a project with these dependencies:

  "devDependencies": {
    "history": "4.2.0",
    "react": "15.3.1",
    "react-dom": "15.3.1",
    "react-icons": "2.2.1",
    "react-router": "4.0.0-2",
    "react-scripts": "0.4.1",
    "react-snapshot": "1.0.2"
  },
  "dependencies": {
    "http-server": "0.9.0"
  },

When I deploy it, I get many errors in the log when trying to install react-snapshot. Any suggestions for fixing this? Thanks!

> Deploying ~/c/thefaithnet
> Using Node.js 6.2.1 (default)
> Ready! https://thefaithnet-iegsuatzeo.now.sh (copied to clipboard) [2s]
> Upload [====================] 100% 0.0s
> Sync complete (659B) [1s]
> Initializing…
> Building
> ▲ npm install
> Installing package [email protected]
> Installing package [email protected]
> Installing package [email protected]
> Installing package [email protected]
> Installing package [email protected]
> Installing package [email protected]
> Installing package [email protected]
> Installing package [email protected]
> node-pre-gyp info it worked if it ends with ok
> node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v48-linux-x64.tar.gz
> node-pre-gyp info check checked for "/home/nowuser/src/node_modules/09ad3fb161afd3f4b10cb78f85ad7a42d2a25d1f/lib/binding/Release/node-v48-linux-x64/fse.node" (not found)
> node-pre-gyp info using [email protected]
> node-pre-gyp info using [email protected] | linux | x64
> node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v48-linux-x64.tar.gz
> node-pre-gyp ERR! Tried to download: https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v48-linux-x64.tar.gz
> node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)
> node-pre-gyp http Pre-built binary not available for your system, looked for https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.14/fse-v1.0.14-node-v48-linux-x64.tar.gz
> gyp info it worked if it ends with ok
> gyp info using [email protected]
> gyp info using [email protected] | linux | x64
> gyp info ok
> gyp info it worked if it ends with ok
> gyp info using [email protected]
> gyp info using [email protected] | linux | x64
> gyp http GET https://nodejs.org/download/release/v6.2.1/node-v6.2.1-headers.tar.gz
> gyp http 200 https://nodejs.org/download/release/v6.2.1/node-v6.2.1-headers.tar.gz
> gyp http GET https://nodejs.org/download/release/v6.2.1/SHASUMS256.txt
> gyp http 200 https://nodejs.org/download/release/v6.2.1/SHASUMS256.txt
> gyp info spawn /usr/bin/python2
> gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
> gyp info spawn args   'binding.gyp',
> gyp info spawn args   '-f',
> gyp info spawn args   'make',
> gyp info spawn args   '-I',
> gyp info spawn args   '/home/nowuser/src/node_modules/09ad3fb161afd3f4b10cb78f85ad7a42d2a25d1f/build/config.gypi',
> gyp info spawn args   '-I',
> gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
> gyp info spawn args   '-I',
> gyp info spawn args   '/home/nowuser/.node-gyp/6.2.1/include/node/common.gypi',
> gyp info spawn args   '-Dlibrary=shared_library',
> gyp info spawn args   '-Dvisibility=default',
> gyp info spawn args   '-Dnode_root_dir=/home/nowuser/.node-gyp/6.2.1',
> gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
> gyp info spawn args   '--generator-output',
> gyp info spawn args   '-Dnode_lib_file=node.lib',
> gyp info spawn args   '-Dmodule_root_dir=/home/nowuser/src/node_modules/09ad3fb161afd3f4b10cb78f85ad7a42d2a25d1f',
> gyp info spawn args   '--depth=.',
> gyp info spawn args   '--no-parallel',
> gyp info spawn args   'build',
> gyp info spawn args   '-Goutput_dir=.' ]
> gyp info ok
> gyp info it worked if it ends with ok
> gyp info using [email protected]
> gyp info using [email protected] | linux | x64
> make: Entering directory '/home/nowuser/src/node_modules/09ad3fb161afd3f4b10cb78f85ad7a42d2a25d1f/build'
>   SOLINK_MODULE(target) Release/obj.target/.node
> gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
> gyp info spawn make
>   COPY Release/.node
> make: Leaving directory '/home/nowuser/src/node_modules/09ad3fb161afd3f4b10cb78f85ad7a42d2a25d1f/build'
> gyp info ok
> node-pre-gyp info ok
> ▲ npm run build

Failed webpack build step of a universal redux react app

I am not sure if this is the place to report issues with now, but here I go anyway.

I keep getting an error in my now deployments.

First of all a little context. I am deploying a server rendered rect app with redux bootstraped using universal kyt, and I have a build step that compiles the app using webpack.

The problem is that the build step fails on now, but works perfectly on my machine. The error I am getting is Module not found: Error: Can't resolve 'lodash/isPlainObject' in '/home/nowuser/src/node_modules/e3d8a6548416ea90c89022179a97a8ef8f8428d0/lib/components' I think that this error comes from the react-redux package (I cannot tell for sure because now shows a hash instead of the package name)

I reproduced the error locally using the same node version and starting from an empty node_modules folder. With this configuration everything works perfectly on my machine, but fails on now.

I hacked a solution by forking react-redux, and changing lodash dependency to lodash.isplainobject because that is the only function that react-redux needs. Using my fork of react-redux everything works fine, so the problem has something to do with now and react-redux lodash dependency.

Anyone came across this kind of error before? Any idea of how to solve this without my ugly fork?

handle.writeLatin1String is not a function on Node 6.5

Works fine on earlier versions of 6.x.

net.js:732
      return handle.writeLatin1String(req, data);
                    ^

TypeError: handle.writeLatin1String is not a function
    at createWriteReq (net.js:732:21)
    at Socket._writeGeneric (net.js:702:11)
    at Socket._write (net.js:725:8)
    at doWrite (_stream_writable.js:307:12)
    at clearBuffer (_stream_writable.js:414:7)
    at Socket.Writable.uncork (_stream_writable.js:243:7)
    at ClientRequest._flushOutput (_http_outgoing.js:666:10)
    at ClientRequest.OutgoingMessage._flush (_http_outgoing.js:640:16)
    at _http_client.js:195:10
    at callSocketMethod (_http_client.js:591:7)

@quarterto

Can't use a numeric value as a secret

If I try to add a secret with a numeric value I get an error, even if I quote it.

E.g:

now secrets add user_id "497017065025001729471"
Error! Only string or an object containing a `base64` key allowed as `value`

I've hacked lib/secrets.js in the now CLI to force the value to be a string, which fixed the error:

fetch('/now/secrets', {
  method: 'POST',
  body: {
    name: name,
    value: `${value}`
  }
});

@Rowno

Failing deploying a file named 404.html

I was deploying a 404.html file and faced some weird problems!

The deploy was successful, but my service worker was always failing to install due to a fetch failure (for this 404.html file, which was always not found when the sw tried to fetch it and store it into cache).

I simply renamed the 404.html into not-found.html and it started working normally.

Any idea about the reason for this behaviour?
In my local environment it works with the 404.html file, tried in many different machines and devices, so, I don't think it is a problem with the service worker itself.

Indeed, after deploying, when going for the /404.html address in the browser, I got a not found page (the zeit's now 404 page) instead of the (existing??) file named 404.html.

Interestingly enough, the 404.png file works normally.

Improve `alias` UX

I know there's been some discussion in zeit.chat about this, but I thought it'd be good to open a issue for further discussion.

I'm not sure of the best solution to improve the aliases experience, but here's some ideas for consideration:

Ability to alias multiple domains at once

I'd like to do this:

now alias <ID> domain.com www.domain.com

instead of this:

now alias <ID> domain.com 
now alias <ID> www.domain.com

Ability to define domain aliases in package.json or some other file

I'd like to do this:

now alias

and have the latest deployment automatically aliased to one or more configured domains

Alternatively, it could be:

now alias <ID>

which would be easy to do since the deployment url is automatically copied to the clipboard.

I know now-realias does something like this, but I think this should be apart of the official client :)

Region selection

@rauchg indicated that I can "handle the region affinity, you'll just have to add a field to package.json under the now namespace." What field should I use to do this?

@aexmachina

What does FROZEN deployment status mean?

I am getting sometimes FROZEN deployment status (deploying via API), for example

FROZEN express-sessions-tutorial-holgtyuece.now.sh

and was wondering if the process should just wait, or if FROZEN deploys should be aborted?

Handle Docker build returning an error code

Description

Instead of continuing after docker build returns a non-zero exit code, now should stop the deployment.

What happens

An example run of what happens now:

scifi» now --version
𝚫 now 0.26.0
scifi» now -e DB_URL=@db-url                                                                          
> Deploying ~/Developer/go/src/kisu.club/scifi
> Using Node.js 6.9.0 (default)
> Ready! https://scifi-bnurmgeuyl.now.sh (copied to clipboard) [4s]
> Initializing…
> Building
> ▲ docker build
>  ---> Using cache
>  ---> ab51cc788ac7
> Step 5 : COPY . /go/src/scifi
>  ---> Using cache
>  ---> 86c222a09002
> Step 6 : RUN go get -d -v
>  ---> Running in be379d337348
> github.com/lib/pq (download)
> go: missing Git command. See https://golang.org/s/gogetcmd
> package github.com/lib/pq: exec: "git": executable file not found in $PATH
> The command 'go get -d -v' returned a non-zero code: 1
> ▲ Storing image
> ▲ docker build
>  ---> f4ef3b6138f0
> Removing intermediate container c3c6d114dc4e
> Step 5 : COPY . /go/src/scifi
>  ---> cd9d38cf7b74
> Removing intermediate container cde385575838
> Step 6 : RUN go get -d -v
>  ---> Running in a71ef90cb15c
> github.com/lib/pq (download)
> go: missing Git command. See https://golang.org/s/gogetcmd
> package github.com/lib/pq: exec: "git": executable file not found in $PATH
> The command 'go get -d -v' returned a non-zero code: 1
> ▲ Storing image
[the build got stuck here I think]

It looks like the build falls back to rebuilding the image from scratch if the initial docker build fails. If the second build fails too, the deployment seems to hang forever.

(The error in this build is that the image doesn't have git, but this report probably applies to any Docker build that returns a non-zero exit code.)

Expected behaviour

After docker build fails, Now should report the error to the user and stop the deployment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.