Home
Support Forums

Need help on deploying Next.js app

I need advice to debug deploy Netlify App

Welcome to the forums @karthik-js

Unfortunately your deploy log is not public making it hard for the community to help you.

The relevant log:

$ npm run build
2:38:33 PM: > boaters-frontend@0.1.0 build
2:38:33 PM: > npm run codegen && next build
2:38:33 PM: > boaters-frontend@0.1.0 codegen
2:38:33 PM: > graphql-let
2:38:35 PM: [ graphql-let ] Scanning...
2:38:35 PM: [ graphql-let ] Processing 6 codegen...
2:38:36 PM: [ graphql-let ] Generating 6 d.ts...
2:38:40 PM: [ graphql-let ] Done processing 6 GraphQL documents.
2:38:41 PM: info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
2:38:41 PM: info  - Checking validity of types...
2:38:56 PM: info  - Creating an optimized production build...
2:39:01 PM: warn - You have enabled the JIT engine which is currently in preview.
2:39:01 PM: warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
2:39:08 PM: [ graphql-let ] Processing src/graphql/posts/getFeaturedPosts.graphql...
2:39:09 PM: [ graphql-let ] Nothing to do. Cache was fresh.
2:39:09 PM: [ graphql-let ] Processing src/graphql/user/getUserPosts.graphql...
2:39:09 PM: [ graphql-let ] Nothing to do. Cache was fresh.
2:39:41 PM: [ graphql-let ] Processing src/graphql/user/getUser.graphql...
2:39:41 PM: [ graphql-let ] Processing src/graphql/posts/getPost.graphql...
2:39:41 PM: [ graphql-let ] Nothing to do. Cache was fresh.
2:39:42 PM: [ graphql-let ] Processing src/graphql/posts/getFeaturedPosts.graphql...
2:39:42 PM: [ graphql-let ] Nothing to do. Cache was fresh.
2:39:45 PM: [ graphql-let ] Processing src/graphql/user/getUserPosts.graphql...
2:39:45 PM: [ graphql-let ] Nothing to do. Cache was fresh.
2:39:50 PM: Failed to compile.
2:39:50 PM: 
2:39:50 PM: ModuleNotFoundError: Module not found: Error: Can't resolve 'canvas' in '/opt/build/repo/node_modules/jsdom/lib/jsdom'
2:39:50 PM: > Build error occurred
2:39:50 PM: Error: > Build failed because of webpack errors
2:39:50 PM:     at /opt/build/repo/node_modules/next/dist/build/index.js:15:924
2:39:50 PM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:6:584)

This might help: