Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Vercel storefront #467

Open
Datsunco opened this issue Feb 17, 2025 · 5 comments
Open

[Bug]: Vercel storefront #467

Datsunco opened this issue Feb 17, 2025 · 5 comments
Assignees
Labels
bug Something isn't working status: needs triaging

Comments

@Datsunco
Copy link

Package.json file

{
  "name": "medusa-next",
  "version": "1.0.3",
  "private": true,
  "author": "Kasper Fabricius Kristensen <kasper@medusajs.com> & Victor Gerbrands <victor@medusajs.com> (https://www.medusajs.com)",
  "description": "Next.js Starter to be used with Medusa V2",
  "keywords": [
    "medusa-storefront"
  ],
  "scripts": {
    "dev": "next dev --turbopack -p 8000",
    "build": "next build",
    "start": "next start -p 8000",
    "lint": "next lint",
    "analyze": "ANALYZE=true next build"
  },
  "dependencies": {
    "@headlessui/react": "^2.2.0",
    "@medusajs/js-sdk": "latest",
    "@medusajs/ui": "latest",
    "@radix-ui/react-accordion": "^1.2.1",
    "@stripe/react-stripe-js": "^1.7.2",
    "@stripe/stripe-js": "^1.29.0",
    "embla-carousel-autoplay": "^8.5.2",
    "embla-carousel-react": "^8.5.2",
    "lodash": "^4.17.21",
    "lucide-react": "^0.474.0",
    "next": "15.0.3",
    "pg": "^8.11.3",
    "qs": "^6.12.1",
    "react": "19.0.0-rc-66855b96-20241106",
    "react-country-flag": "^3.1.0",
    "react-dom": "19.0.0-rc-66855b96-20241106",
    "server-only": "^0.0.1",
    "tailwindcss-radix": "^2.8.0",
    "webpack": "^5"
  },
  "devDependencies": {
    "@babel/core": "^7.17.5",
    "@medusajs/types": "latest",
    "@medusajs/ui-preset": "latest",
    "@types/lodash": "^4.14.195",
    "@types/node": "17.0.21",
    "@types/pg": "^8.11.0",
    "@types/react": "^18.3.12",
    "@types/react-dom": "^18.3.1",
    "@types/react-instantsearch-dom": "^6.12.3",
    "ansi-colors": "^4.1.3",
    "autoprefixer": "^10.4.2",
    "babel-loader": "^8.2.3",
    "eslint": "8.10.0",
    "eslint-config-next": "15.0.3",
    "postcss": "^8.4.8",
    "prettier": "^3.4.2",
    "prettier-plugin-tailwindcss": "^0.6.11",
    "tailwindcss": "^3.0.23",
    "typescript": "^5.3.2"
  },
  "packageManager": "yarn@3.2.3",
  "resolutions": {
    "@types/react": "npm:types-react@19.0.0-rc.1",
    "@types/react-dom": "npm:types-react-dom@19.0.0-rc.1"
  },
  "overrides": {
    "react": "19.0.0-rc-66855b96-20241106",
    "react-dom": "19.0.0-rc-66855b96-20241106"
  }
}

Node.js version

v21.0.0

Operating system name and version

ubuntu 22.04

Browser name

No response

What happended?

After a successful deployment on Vercel, I'm getting a 500 error.

Image

Image

Expected behavior

This project is running smoothly on my Ubuntu server.

Image

Actual behavior

In the logs of Vercel, I see this error:
SyntaxError: Unexpected token 'D', "Direct IP "... is not valid JSON
at JSON.parse ()
at parseJSONFromBytes (/opt/rust/undici-runtime.js:13:2854)
at successSteps (/opt/rust/undici-runtime.js:13:2560)
at fullyReadBody (/opt/rust/undici-runtime.js:3:7811)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async consumeBody (/opt/rust/undici-runtime.js:13:2664)
at async user-source.js:28:35377
at async sr (user-source.js:28:35150)
at async ur (user-source.js:28:36039)
at async handler (user-source.js:28:36800)

Link to reproduction repo

https://github.com/Datsunco/mejory

@Datsunco Datsunco added bug Something isn't working status: needs triaging labels Feb 17, 2025
@riqwan
Copy link
Contributor

riqwan commented Feb 18, 2025

Hey @Datsunco, can't view your repository. But i don't believe this is an issue with Medusa. Anything you changed in there? Ensure that you're not running on edge.

@riqwan riqwan self-assigned this Feb 18, 2025
@Datsunco
Copy link
Author

I'm so sorry, I just now opened my repository.

@riqwan
Copy link
Contributor

riqwan commented Feb 21, 2025

Hey @Datsunco, once again, I don't believe this is a Medusa error. I can see that after your first commit, the entire dep tree has been removed and installed based on your runtime.

Can you create a new project and deploy that on vercel? I just tried it and works ok

@bxclib2
Copy link

bxclib2 commented Mar 22, 2025

Hi, I have the same issue. I changed nothing. I believe it is a Medusa error

@bxclib2
Copy link

bxclib2 commented Mar 22, 2025

Hi, I know where the issue is.

If you log the error
you will get Error body: Direct IP access is not allowed in Vercel's Edge environment (hostname: *****)

Vercel Edge runtime won't allow http request to a ip address. Just attach a domain name to your store backend will solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: needs triaging
Projects
None yet
Development

No branches or pull requests

3 participants