#Cannot destructure property 'buildConfig' ERROR

1 messages · Page 1 of 1 (latest)

tropic mulch
#

Hi folks!

I have updated our SSR project to 2.0 and running into build issues. See below:

work@Andrass-MacBook-Air portal % npm run build

> [email protected] build
> astro build

 error   Cannot destructure property 'buildConfig' of 'undefined' as it is undefined.
  File:
    /Users/work/Hackurity/portal/node_modules/@astrojs/vercel/dist/serverless/adapter.js:32:37
  Code:
    31 |       },
    > 32 |       "astro:build:start": async ({ buildConfig }) => {
         |                                     ^
      33 |         buildConfig.serverEntry = serverEntry = "entry.js";
      34 |         buildConfig.client = new URL("./static/", _config.outDir);
      35 |         buildConfig.server = functionFolder = new URL("./functions/render.func/", _config.outDir);
  Stacktrace:
TypeError: Cannot destructure property 'buildConfig' of 'undefined' as it is undefined.
    at Object.astro:build:start (file:///Users/work/Hackurity/portal/node_modules/@astrojs/vercel/dist/serverless/adapter.js:32:37)
    at runHookBuildStart (file:///Users/work/Hackurity/portal/node_modules/astro/dist/integrations/index.js:160:59)
    at AstroBuilder.build (file:///Users/work/Hackurity/portal/node_modules/astro/dist/core/build/index.js:65:11)
    at AstroBuilder.run (file:///Users/work/Hackurity/portal/node_modules/astro/dist/core/build/index.js:127:18)
    at async build (file:///Users/work/Hackurity/portal/node_modules/astro/dist/core/build/index.js:21:3)
    at async runCommand (file:///Users/work/Hackurity/portal/node_modules/astro/dist/cli/index.js:157:14)
    at async cli (file:///Users/work/Hackurity/portal/node_modules/astro/dist/cli/index.js:180:5)

And this is how the astro.config.mjs looks like:


import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';

// https://astro.build/config
export default defineConfig({
  output: "server",
  adapter: vercel(),
  base: "/"
});

Using Astro version: "^2.0.1"
Using Vercel version: "^1.0.2"

wary bough
#

You need to update @astrojs/vercel to ^3.0.0

tropic mulch
#

I thought the current one was latest because installing it via the npm install does not change the package

#

updated astro via @latest

#

worked just fine

#

it seems like it did not however for Vercel

#

Alrighty, deleting everything, rewriting it manually and doing an install fixed it