Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Deployment to Now v2 #119

Open
ekkis opened this issue Apr 7, 2020 · 2 comments
Open

Deployment to Now v2 #119

ekkis opened this issue Apr 7, 2020 · 2 comments

Comments

@ekkis
Copy link

ekkis commented Apr 7, 2020

Describe the bug
Deployment attempt produces an error

To Reproduce
Follow instructions in README

Expected behavior
A deployed website

Node version, NPM version and Operating System and version
Node: 13.7.0
NPM: 6.14.1
OS: OSX 10.14.6

Additional context

First of all, the project includes a now.json that contains bad information. Names are no longer used and the version is set to 1, causing Now to refuse deployment. I simply deleted the file and ran now but then i puked with the following:

2020-04-07T00:06:37.615Z Error: Found engines in package.json with an invalid Node.js version range: "8.11.x".
2020-04-07T00:06:37.615Z Please set "engines": { "node": "12.x" } in your package.json file to upgrade to Node.js 12. Learn more: https://zeit.co/docs/runtimes#official-runtimes/node-js/node-js-version

after patching the package.json as instructed Now fails with the following:

2020-04-07T00:09:43.170Z Error: No serverless pages were built. https://err.sh/zeit/now/now-next-no-serverless-pages-built
2020-04-07T00:09:43.170Z at Object.module.exports.178.exports.build (/zeit/f8b3553cce6cf4b4/.build-utils/.builder/node_modules/@now/next/dist/index.js:4041:19)
2020-04-07T00:09:43.170Z at async buildStep (/var/task/sandbox-worker.js:20371:20)
2020-04-07T00:09:43.170Z at async mainSub (/var/task/sandbox-worker.js:20116:9)
2020-04-07T00:09:43.170Z at async main (/var/task/sandbox-worker.js:20023:5)

so I guess Now expects something this project isn't providing. clue anyone?

@ekkis
Copy link
Author

ekkis commented Apr 7, 2020

as described in the above link, I've added target: 'serverless' to the next.config.js and "now-build": "next build" to the package.json. also ran yarn add next@canary as described here: https://github.com/zeit/now-builders/issues/155 which changed the 'latest' version with a real version in the dependence list

finally, added back a now.json:

{
  "alias": ["mwg.ekkis.now.sh"],
  "name": "mwg",
  "version": 2,
  "builds": [{ "src": "next.config.js", "use": "@now/next" }]
}

but it just refuses to deploy

one more thing, I changed the "now-build" script in package.json to next build && next export -o dist and now.json now uses "builds": [{ "src": "package.json", "use": "@now/static-build" }] but to no avail

this is utterly hopeless. I've now burnt a couple of hours and I can't even install

@SpainTrain
Copy link

I was experiencing a similar issue and adding

target: 'experimental-serverless-trace',

to next.config.js.

Note that builds is a deprecated config key in the latest version of now. The project that I had this issue with sets the build info in Project Settings via the zeit web UI, which I think is the direction Zeit is headed with this kind of config to support monorepo and other use cases. As another troubleshooting step you may try that out (and double check that now CLI is on the latest version). Hope that helps and good luck!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants