Git Product home page Git Product logo

Comments (6)

619 avatar 619 commented on May 8, 2024

I am using ^0.4.0 version of @vercel/postgres (in package.json)

from edge-config.

adriancooney avatar adriancooney commented on May 8, 2024

Thanks for the report @619. Before we can help, we'll need more context on the problem - ideally a minimal reproduction. We'll need to know things like:

  • Node version
  • Vercel CLI version
  • The contents of the package.json
  • The contents of the vercel.json, if any. (this is not related to your .vercel directory)
  • Your file structure and an example of the API handler
  • How you are deploying the code - via git or via vercel deploy command?

To best help us solve the issue here, an exact reproduction published to Github would be great.

from edge-config.

619 avatar 619 commented on May 8, 2024

Sure, I can do that. Is there a private means of doing so? I'm not pushing my code to a public repo. It would be even better if I can authenticate/allow you to look at my project on vercel so you can see everything yourself.

Node v: 18.16.0 (ran node -v locally)
Vercel CLI v: 29.3.1
package.json:

{
  "name": "NAME",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@vercel/postgres": "^0.4.0",
    "eslint": "8.44.0",
    "eslint-config-next": "13.4.8",
    "next": "^13.4.8",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  }
}

vercel.json: I can show you privately.

from edge-config.

619 avatar 619 commented on May 8, 2024

Oh yes, I forgot to mention that I generated this project from the nextjs clone template on vercel.

from edge-config.

619 avatar 619 commented on May 8, 2024

Update: I created another repo using the nextJS template on vercel, copied my code from api/redirect.js and vercel.json, installed @vercel/postgres using npm, and I got the same error. @vercel/postgres does indeed break in production.

from edge-config.

619 avatar 619 commented on May 8, 2024

The issue was that I was using an import statement in a serverless function.

I was using:
import { sql } from '@vercel/postgres';

when I should have been using:
const { sql } = require('@vercel/postgres')

from edge-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.