#Failed to collect page data

3 messages · Page 1 of 1 (latest)

honest mist
#

I'm not entirely sure why, but the page below does not work with the export const runtime = "edge" flag, but does without it.

import { db } from "~/utils";

export const dynamic = "force-dynamic";
export const runtime = "edge";

export default async function Profile() {
  const test = await db.query.users.findFirst();

  console.log(test);

  return <div></div>;
}

Here's the build output:

@knighthacks/2024:build:    Collecting page data ...
@knighthacks/2024:build:  ⚠ Using edge runtime on a page currently disables static generation for that page
@knighthacks/2024:build: SyntaxError: Invalid regular expression: /^((?<username>[^:]*)(:(?<password>.*))?@)?((?<host>[^:\\[\\]]*)|(\\[(?<host_br>[^\\[\\]]*)\\]))(:(?<port>[0-9]*))?$/su: Lone quantifier brackets
@knighthacks/2024:build:     at RegExp (<anonymous>)
@knighthacks/2024:build:     at 1183 (/Users/mirage/dev/knighthacks/apps/2024/.next/server/app/test/page.js:127:17154)
@knighthacks/2024:build:     at Function.__webpack_require__ (/Users/mirage/dev/knighthacks/apps/2024/.next/server/edge-runtime-webpack.js:25:42)
@knighthacks/2024:build:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@knighthacks/2024:build: 
@knighthacks/2024:build: > Build error occurred
@knighthacks/2024:build: Error: Failed to collect page data for /test
@knighthacks/2024:build:     at /Users/mirage/dev/knighthacks/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/build/utils.js:1258:15
@knighthacks/2024:build:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
@knighthacks/2024:build:   type: 'Error'
@knighthacks/2024:build: }
@knighthacks/2024:build:  ELIFECYCLE  Command failed with exit code 1.
@knighthacks/2024:build:  ELIFECYCLE  Command failed with exit code 1.
@knighthacks/2024:build: ERROR: command finished with error: command (/Users/mirage/dev/knighthacks/apps/2024) /Users/mirage/.nvm/versions/node/v20.12.2/bin/pnpm run build exited (1)
@knighthacks/2024#build: command (/Users/mirage/dev/knighthacks/apps/2024) /Users/mirage/.nvm/versions/node/v20.12.2/bin/pnpm run build exited (1)

I'm using Drizzle ORM with Turso and I'm simply trying to make a db call in an rsc using the edge runtime.

hallow juniperBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

honest mist
#

Interestingly upgrading to next 14.2.0 fixed my issue :/