adrianhajdin / ecommerce_sanity_stripe

Modern Full Stack ECommerce Application with Stripe

Home Page:https://jsmastery.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in Deploying in Vercel

hammadsohail opened this issue · comments

Following error is being orccured.
error - ESLint: Failed to load config "next/babel" to extend from. Referenced from: /vercel/path0/.eslintrc.json

My Log file;
[22:42:45.867] Cloning github.com/hammadsohail/ecommerce_sanity_stripe (Branch: main, Commit: e24ccfc) [22:42:46.012] Previous build cache not available [22:42:46.658] Cloning completed: 790.981ms [22:42:46.946] Running "vercel build" [22:42:47.589] Vercel CLI 28.9.0 [22:42:47.997] Running "install" command: npm install --legacy-peer-deps... [22:43:00.681] [22:43:00.681] added 331 packages, and audited 332 packages in 12s [22:43:00.681] [22:43:00.681] 82 packages are looking for funding [22:43:00.682] run npm fundfor details [22:43:00.683] [22:43:00.683] found 0 vulnerabilities [22:43:00.708] Detected Next.js version: 13.0.6 [22:43:00.713] Detectedpackage-lock.json generated by npm 7+... [22:43:00.714] Running "npm run build" [22:43:01.111] [22:43:01.111] > ecommerce@0.1.0 build [22:43:01.111] > next build [22:43:01.111] [22:43:01.480] info - Loaded env from /vercel/path0/.env [22:43:01.665] Attention: Next.js now collects completely anonymous telemetry regarding usage. [22:43:01.666] This information is used to shape Next.js' roadmap and prioritize features. [22:43:01.667] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: [22:43:01.668] https://nextjs.org/telemetry [22:43:01.668] [22:43:01.956] info - Linting and checking validity of types... [22:43:02.455] error - ESLint: Failed to load config "next/babel" to extend from. Referenced from: /vercel/path0/.eslintrc.json [22:43:02.463] info - Creating an optimized production build... [22:43:02.518] info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled [22:43:03.248] info - Using external babel configuration from /vercel/path0/.babelrc [22:43:08.424] Failed to compile. [22:43:08.424] [22:43:08.424] ./components/Navbar.jsx [22:43:08.425] Module not found: Can't resolve 'next/Link' in '/vercel/path0/components' [22:43:08.425] [22:43:08.425] Import trace for requested module: [22:43:08.425] ./components/Navbar.jsx [22:43:08.425] ./components/index.js [22:43:08.425] [22:43:08.426] ./lib/client.js [22:43:08.426] Module not found: Can't resolve '@sanity/Client' in '/vercel/path0/lib' [22:43:08.426] [22:43:08.426] Import trace for requested module: [22:43:08.426] ./lib/client.js [22:43:08.426] [22:43:08.426] [22:43:08.426] > Build failed because of webpack errors [22:43:08.465] Error: Command "npm run build" exited with 1

My package.Json
{ "name": "ecommerce", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@babel/core": "^7.17.9", "@sanity/client": "^3.2.0", "@sanity/image-url": "^1.0.1", "@stripe/stripe-js": "^1.25.0", "canvas-confetti": "^1.5.1", "next": "12.1.0", "next-sanity-image": "^3.2.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hot-toast": "^2.2.0", "react-icons": "^4.3.1", "stripe": "^8.209.0" }, "devDependencies": { "@babel/preset-react": "^7.18.6", "eslint": "8.13.0", "eslint-config-next": "12.1.4", "next": "13.0.6" } }

My eslintrc.json
{ "name": "ecommerce", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@babel/core": "^7.17.9", "@sanity/client": "^3.2.0", "@sanity/image-url": "^1.0.1", "@stripe/stripe-js": "^1.25.0", "canvas-confetti": "^1.5.1", "next": "12.1.0", "next-sanity-image": "^3.2.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hot-toast": "^2.2.0", "react-icons": "^4.3.1", "stripe": "^8.209.0" }, "devDependencies": { "@babel/preset-react": "^7.18.6", "eslint": "8.13.0", "eslint-config-next": "12.1.4", "next": "13.0.6" } }

Please Help guys

You got it now? can I see your code? try this:

before adding the variables, add a build command on the 3rd row. check the box and add ' npm install --force'.
let me know if it works

@NabintouSFofana this was really a help. thanks

in my case i got different problems:
Captura de pantalla 2023-01-16 a las 19 04 09

image

i am getting this

in my case i got different problems: Captura de pantalla 2023-01-16 a las 19 04 09

try this:
image

It working like this:
Separate the server folder you can create new branch and push the server folder there.
just remove the the sanity server folder then deploy only frontend.

for monorepo gives the above error

in my case i got different problems: Captura de pantalla 2023-01-16 a las 19 04 09

try this: image

tnx these worked for me