Seeking guidance on deploying Next.js with Vercel, I have made changes to the structure of my Next.js project:
- frontend (Current Directory for Next.js)
- node_modules
- next.config.js
- jsconfig.json
- package-lock.json
- package.json
Contents of package.json script:
"scripts": {
"dev": "next frontend dev",
"build": "next build frontend",
"start": "next start frontend",
"lint": "next lint frontend"
},
Contents of next.config.js script:
const path = require('path')
const alias = {
'@/components': path.join(__dirname, 'frontend', 'components'),
'@/containers': path.join(__dirname, 'frontend', 'containers'),
'@/styles': path.join(__dirname, 'frontend', 'scss')
}
module.exports = {
reactStrictMode: true,
sassOptions: {
includePaths: [path.join(__dirname, 'frontend/scss')]
},
images: {
domains: ['source.unsplash.com'],
loader: 'imgix',
path: 'https://noop/'
},
webpack: (config) => {
config.resolve.alias = Object.assign(
{},
config.resolve.alias,
alias
)
return config
}
}
After importing to Vercel, the build is successful. However, the message received is:
Error: The file "/vercel/path1/.next/routes-manifest.json" couldn't be found. This is normally caused by a misconfiguration in your project.
Should I modify the build output, or is there a more optimal solution?