Reputation: 320
When I push my Next project to GitHub, I get the following error : You defined 1 build that did not match any source files (please ensure they are NOT defined in .nowignore) and this how my now.json looks like:
`
{
"version": 2,
"builds": [
{
"src": "packages/web-app/package.json",
"use": "@now/next"
}
],
"build": {
"env": {
"SECRET": "dev-key",
"ANOTHER_SECRET": "another-dev-key"
}
}
}
`
and Package.json file which located on the root folder contains the following :
`
{
"name": "biletiniz",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"bootstrap": "lerna bootstrap",
"dev": "lerna bootstrap && lerna run dev",
"build": "lerna bootstrap && lerna run build",
"start": "lerna bootstrap && lerna run start"
},
"dependencies": {
"lerna": "^3.16.4"
},
"version": "1.0.0",
"author": "LamaDabbeet",
"license": "MIT"
}
Upvotes: 1
Views: 1329
Reputation: 2852
try this in Now.js V2:
{
"version": 2,
"name": "awesome-app",
"builds": [
{
"src": "packages/next-app/package.json",
"use": "@now/next"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/packages/next-app/$1",
"headers": {
"x-request-path": "$1"
}
}
],
"env": {
"SECRET": "dev-key",
"ANOTHER_SECRET": "another-dev-key"
}
}
Where next-app
is your next.js app package
Upvotes: 2