I've been trying to deploy my NextJS onto Vercel, but keep getting the following error:
19:07:34.256
> Build error occurred
19:07:34.257
Error: Failed to load config "next/babel" to extend from.
19:07:34.258
Referenced from: /vercel/path0/.eslintrc
19:07:34.258
type: 'Error',
19:07:34.258
messageTemplate: 'extend-config-missing',
19:07:34.258
messageData: { configName: 'next/babel', importerName: '/vercel/path0/.eslintrc' }
19:07:34.258
}
19:07:34.277
Error: Command "npm run build" exited with 1
Below is my .babelrc file:
{
"presets": ["next/babel"],
"plugins": []
}
My .eslintrc file:
{
"extends": ["next/babel"]
}
And my package-json file:
{
"name": "google-docs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#material-tailwind/react": "0.3.4",
"#next-auth/firebase-adapter": "^0.1.2",
"draft-js": "^0.11.7",
"firebase": "^8.9.1",
"next": "11.0.1",
"next-auth": "^3.27.3",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-draft-wysiwyg": "^1.14.7",
"react-firebase-hooks": "^3.0.4"
},
"devDependencies": {
"autoprefixer": "^10.3.1",
"eslint": "7.32.0",
"eslint-config-next": "11.0.1",
"postcss": "^8.3.6",
"tailwindcss": "^2.2.7"
}
}
Also, building the project locally is also not working because of the same error. How do I solve this issue? Thank you in advance.
For those who are wondering, the solution that I used is first to remove the "next/babel" from the extends array, as julio has suggested.
Then, I install babel-eslint:
npm i babel-eslint --save-dev
I then changed the entire .eslintrc file to this:
{
"parser": "babel-eslint"
}
And the build was successful! Credit goes julio and the answers from this thread:
Parsing Error The Keyword import is Reserved (SublimeLinter-contrib-eslint)
Related
I got this error when trying to build with vercel
Error: No Next.js version could be detected in your project. Make sure `"next"` is installed in "dependencies" or "devDependencies"
Despite next being in my dependencies, the app was created with 'create-next-app', i'm not sure at all what to do here can anyone help me out?
Here is my package folder:
{
"name": "project1",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "node server.mjs",
"lint": "next lint"
},
"dependencies": {
"#reduxjs/toolkit": "^1.8.5",
"next": "^12.2.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-redux": "^7.2.8",
},
"devDependencies": {
"eslint": "8.20.0",
"eslint-config-next": "12.2.3"
}
}
Keystone fails to find dependencies while running yarn build inside a new Turborepo project.
Steps to reproduce
Install Turborepo in a new project npx create-turbo#latest
navigate to the apps folder or wherever you plan to install Keystone cd apps/
install keystone yarn create keystone-app
navigate back to the root directory cd ../
add .keystone/** to turbo.json Pipeline:
"build": {"dependsOn": [ "^build" ], "outputs": [ ".next/**", ".keystone/admin/.next/**" ]}}
build project from root directory cd ../ && yarn build
Observe error message from inside ./keystone
turbo.json
{
"pipeline": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
".keystone/admin/.next/**"
]
},
"dev": {
"cache": false
},
"clean": {
"cache": false
}
},
"globalDependencies": [
"tsconfig.json",
".prettierrc.json",
".eslintrc.json",
"Procfile"
]
}
package.json
{
"private": true,
"workspaces": [
"packages/*",
"apps/*"
],
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --no-cache --parallel --continue",
"lint": "turbo run lint",
"test": "turbo run test",
"clean": "turbo run clean && rm -rf node_modules",
"format": "prettier --write \"**/*.{ts,tsx,js,md}\""
},
"devDependencies": {
"prettier": "^2.5.1",
"turbo": "latest"
},
"packageManager": "yarn#1.22.18"
}
apps/keystoneCMS/package.json
{
"name": "logly-admin",
"version": "1.0.0",
"private": true,
"main": "keystone.ts",
"scripts": {
"dev": "keystone dev",
"start": "keystone start",
"build": "keystone build && keystone prisma migrate deploy",
"postinstall": "keystone postinstall"
},
"dependencies": {
"#emotion/css": "^11.7.1",
"#keystone-6/auth": "^1.0.1",
"#keystone-6/cloudinary": "^1.0.0",
"#keystone-6/core": "^1.1.0",
"#keystone-6/fields-document": "^1.0.1",
"#prisma/client": "^3.8.1",
"autoprefixer": "^10.4.2",
"dotenv": "^10.0.0",
"formik": "^2.2.9",
"postcss": "^8.4.7",
"tailwind": "^4.0.0",
"tailwindcss": "^3.0.23",
"typescript": "^4.5.4"
},
"engines": {
"node": "^14.15 || ^16.13"
}
}
Github issue for more context: https://github.com/keystonejs/keystone/issues/7518
Versions
Node: v16.13.1 (latest)
Keystone: v6 (latest)
Turborepo: 1.2.8 (latest)
I have been able to replicate this, and it looks to be an issue with the next version that npx create-turbo#latest installs and is pinned to. Running create-turbo installs next 12.0.8 and is pinned to that version. Keystone requires at least version 12.1.0.
When I changed my ./apps/web/package.json to:
"dependencies": {
"next": "^12.1.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"ui": "*"
},
The error no longer occurred.
I went to redeploy my vue3 website this morning and the build kept failing with this message:
- Building for production...
ERROR Failed to compile with 1 error1:45:13 PM
error in ./src/main.js
Syntax Error: Thread Loader (Worker 0)
Failed to load config "plugin:vue/vue3-essential" to extend from.
Referenced from: /home/runner/work/nonunonu-site/nonunonu-site/package.json
at Array.reduceRight (<anonymous>)
# multi ./src/main.js
ERROR Build failed with errors.
Error: Process completed with exit code 1.
after googling about and trying various fixes I apparently broke my project even more, and now I'm receiving this message when I try to run npm run serve
enter code hereStarting development server...
12% building ... modules 0 active/home/andy/Documents/Websites/nonunonu/node_modules/webpack/lib/Dependency.js:332
throw new Error(
^
Error: module property was removed from Dependency (use compilation.moduleGraph.updateModule(dependency, module) instead)
at ProvidedDependency.set (/home/andy/Documents/Websites/nonunonu/node_modules/webpack/lib/Dependency.js:332:9)
at iterationDependencies (/home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/Compilation.js:940:21)
at /home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/Compilation.js:950:8
at /home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js:409:6
at /home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js:155:13
at eval (eval at create (/home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:178:9
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:125:7
at CaseSensitivePathsPlugin.fileExistsWithCase (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:95:5)
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:118:10
at CaseSensitivePathsPlugin.getFilenamesInDir (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:52:5)
at CaseSensitivePathsPlugin.fileExistsWithCase (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:101:8)
at /home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:118:10
at Array.<anonymous> (/home/andy/Documents/Websites/nonunonu/node_modules/case-sensitive-paths-webpack-plugin/index.js:72:5)
at Storage.finished (/home/andy/Documents/Websites/nonunonu/node_modules/#vue/cli-service/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
I'm fairly new to development, so any help or suggestions would be great, at this point I feel like deleting the whole site and starting again. thanks!
here is my package.json
{
"name": "nonunonu",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"animejs": "^3.2.1",
"core-js": "^3.6.5",
"vue": "^3.0.0"
},
"devDependencies": {
"#vue/cli-plugin-babel": "^3.3.0",
"#vue/cli-service": "^3.12.1",
"#vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^8.8.0",
"eslint-plugin-vue": "^7.20.0",
"sass": "^1.32.12",
"sass-loader": "^10",
"webpack": "^5.68.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
I´m currently working on a website using vue/cli 4.5.13 and firebase.
After trying to get a simple authentification site working, my npm run build fails with this message:
ERROR Failed to compile with 1 error
Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined
You may use special comments to disable some warnings. Use //
eslint-disable-next-line to ignore the next line. Use /*
eslint-disable */ to ignore all warnings in a file. ERROR Build
failed with errors.
I know this problem was asked here frequently but all the given solutions didn´t work for me.
So far i tried: npm install typescript#latest, npm uninstall #vue/component-compiler-utils,
npm install --dev #vue/component-compiler-utils#3.1.2, npm update vue-template-compiler and npm audit fix (--force).
my package.json looks like this:
"name": "my-website",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"#vue/component-compiler-utils": "^3.1.2",
"core-js": "^3.6.5",
"typescript": "^4.3.2",
"vue": "^3.0.2"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "^3.1.1",
"#vue/cli-service": "^3.5.3",
"#vue/compiler-sfc": "^3.0.2",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
Try to delete node modules directory and then run
npm install
My package.json file is
{
"name": "learn-starter",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"export": "next export"
},
"dependencies": {
"#tailwindcss/typography": "^0.2.0",
"date-fns": "^2.16.1",
"geolib": "^3.3.1",
"google-map-react": "^2.1.3",
"graphql": "^15.3.0",
"graphql-request": "3.0.0",
"gray-matter": "^4.0.2",
"isomorphic-unfetch": "^3.0.0",
"libphonenumber-js": "^1.7.57",
"next": "9.3.5",
"next-seo": "^4.7.3",
"react": "16.13.1",
"react-animated-css": "^1.2.1",
"react-dom": "16.13.1",
"react-gtm-module": "^2.0.11",
"react-static-google-map": "^0.6.2",
"remark": "^12.0.1",
"remark-html": "^12.0.0",
"tailwindcss": "^1.7.6",
"use-position": "^0.0.7"
},
"devDependencies": {}
}
I am trying to use revaildate: 1 in getStaticProps but I am getting error saying
Error: The `revalidate` property is not yet available for general use.
To try the experimental implementation, please use `unstable_revalidate` instead.
As I can see in package.json file my nextjs version is 9.3.5
Can anyone help me what I should do to fix this.
Try using "unstable_revalidate" instead of "revalidate", because in nextjs version <9.5, "revalidate" keyword is not yet generalised.