ecommerce_sanity_stripe icon indicating copy to clipboard operation
ecommerce_sanity_stripe copied to clipboard

Error in Deploying in Vercel

Open hammadsohail opened this issue 2 years ago • 10 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] > [email protected] 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" } }

hammadsohail avatar Dec 15 '22 17:12 hammadsohail

Please Help guys

hammadsohail avatar Dec 15 '22 17:12 hammadsohail

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 avatar Dec 27 '22 03:12 NabintouSFofana

got it thanks!

On Tue, Dec 27, 2022 at 8:44 AM Nabintou Sandiouale Fofana < @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/ecommerce_sanity_stripe/issues/90#issuecomment-1365587191, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ2NUKULCNKT32NVKW3MOW3WPJQ2JANCNFSM6AAAAAATAAH6HM . You are receiving this because you authored the thread.Message ID: @.***>

hammadsohail avatar Dec 28 '22 02:12 hammadsohail

😀

NabintouSFofana avatar Dec 31 '22 06:12 NabintouSFofana

@NabintouSFofana this was really a help. thanks

ashharr avatar Jan 09 '23 07:01 ashharr

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

abg1995 avatar Jan 16 '23 18:01 abg1995

image

i am getting this

Az1m04 avatar Jan 19 '23 19:01 Az1m04

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

try this: image

Az1m04 avatar Jan 19 '23 19:01 Az1m04

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

Az1m04 avatar Jan 26 '23 13:01 Az1m04

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

filiptrifunovic-mile avatar Jan 27 '23 15:01 filiptrifunovic-mile