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

Problem with building example-marketing. #732

Open
xavier-xia-99 opened this issue Mar 27, 2024 · 0 comments
Open

Problem with building example-marketing. #732

xavier-xia-99 opened this issue Mar 27, 2024 · 0 comments
Labels
question Question asked by a user triage A new issue that needs triage

Comments

@xavier-xia-99
Copy link

xavier-xia-99 commented Mar 27, 2024

Package

example-marketing

Ask the question

I am unable to build locally or on Vercel this example. Really appreciate any advice as I have little frontend experience.

There are other fixes I had to do up to this point, not sure if they are right.

  1. update next.config.js images field to an array

images: { domains: process.env.NEXT_IMAGE_DOMAIN ? [process.env.NEXT_IMAGE_DOMAIN] : [], },

  1. update the import for domhandler in formatted-text.tsx from import { Element } from "domhandler/lib/node" to import { Element } from "domhandler"

  2. renamed env .env.example to just .env

Additional context

Ran into this error message on both local and Vercel build attempts:

Local Error :

❯ npm run build

> example-marketing@1.5.0 build
> next build && next export

info  - Loaded env from /Users/boxia/Projects/drupal-nextjs-marketing-site/.env
info  - Linting and checking validity of types
info  - Creating an optimized production build
info  - Compiled successfully
info  - Collecting page data ..[next-drupal][error]: Error: Failed to fetch JSON:API index at http://localhost:8080/es/jsonapi - fetch failed
    at /Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next-drupal/dist/index.js:2053:28
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)
    at async Promise.all (index 0)
    at async getStaticPaths (/Users/boxia/Projects/drupal-nextjs-marketing-site/.next/server/pages/[[...slug]].js:121:16)
    at async buildStaticPaths (/Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/build/utils.js:592:33)
    at async /Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/build/utils.js:886:115
    at async Span.traceAsyncFn (/Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/trace/trace.js:79:20)
TypeError: Cannot read properties of undefined (reading 'links')
    at /Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next-drupal/dist/index.js:2075:42
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)
    at async Promise.all (index 0)
    at async getStaticPaths (/Users/boxia/Projects/drupal-nextjs-marketing-site/.next/server/pages/[[...slug]].js:121:16)
    at async buildStaticPaths (/Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/build/utils.js:592:33)
    at async /Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/build/utils.js:886:115
    at async Span.traceAsyncFn (/Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/trace/trace.js:79:20)

> Build error occurred
Error: Failed to collect page data for /[[...slug]]
    at /Users/boxia/Projects/drupal-nextjs-marketing-site/node_modules/next/dist/build/utils.js:916:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'Error'
}

Vercel Error :
Vercel App
Github Repo

@xavier-xia-99 xavier-xia-99 added question Question asked by a user triage A new issue that needs triage labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question asked by a user triage A new issue that needs triage
Projects
None yet
Development

No branches or pull requests

1 participant