Build - Deploy Issue

Hi,
I tried to deploy my app thousands time however always getting same error:

6:12:21 PM: $ npm run build
6:12:21 PM: > project@0.1.0 build
6:12:21 PM: > next build
6:12:22 PM: :warning: No build cache found. Please configure build caching for faster rebuilds. Read more: No Cache Detected | Next.js
6:12:22 PM: ▲ Next.js 14.1.0
6:12:22 PM: Creating an optimized production build …
6:12:31 PM: ✓ Compiled successfully
6:12:31 PM: Skipping linting
6:12:31 PM: Checking validity of types …
6:12:34 PM: Failed to compile.
6:12:34 PM:
6:12:34 PM: ./components/ui/calendar.tsx:5:27
6:12:34 PM: Type error: Cannot find module ‘react-day-picker’ or its corresponding type declarations.
6:12:34 PM: 3 | import * as React from ‘react’;
6:12:34 PM: 4 | import { ChevronLeft, ChevronRight } from ‘lucide-react’;
6:12:34 PM: > 5 | import { DayPicker } from ‘react-day-picker’;
6:12:34 PM: | ^
6:12:34 PM: 6 |
6:12:34 PM: 7 | import { cn } from ‘@/lib/utils’;
6:12:34 PM: 8 | import { buttonVariants } from ‘@/components/ui/button’;
6:12:34 PM: ​
6:12:34 PM: “build.command” failed
6:12:34 PM: ────────────────────────────────────────────────────────────────
6:12:34 PM: ​
6:12:34 PM: Error message
6:12:34 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
6:12:34 PM: ​
6:12:34 PM: Error location
6:12:34 PM: In Build command from Netlify app:
6:12:34 PM: npm run build
6:12:34 PM: ​
6:12:34 PM: Resolved config
6:12:34 PM: build:
6:12:34 PM: command: npm run build
6:12:34 PM: commandOrigin: ui
6:12:34 PM: publish: /opt/build/repo/public
6:12:34 PM: publishOrigin: ui
6:12:34 PM: plugins:
6:12:34 PM: - inputs: {}
6:12:34 PM: origin: ui
6:12:34 PM: package: ‘@netlify/plugin-nextjs’
6:12:35 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
6:12:35 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:12:35 PM: Failing build: Failed to build site
6:12:35 PM: Finished processing build request in 37.708s

anyone can help me?

Also getting always same error from bolt:

./components/ui/accordion.tsx:4:37
Type error: Cannot find module ‘@radix-ui/react-accordion’ or its corresponding type declarations.

2 |
3 | import * as React from ‘react’;

4 | import * as AccordionPrimitive from ‘@radix-ui/react-accordion’;
| ^
5 | import { ChevronDown } from ‘lucide-react’;
6 |
7 | import { cn } from ‘@/lib/utils’;

neither fix helps to solve it…

I presume this is just hyperbole?


The error is located here:

6:12:34 PM: ./components/ui/calendar.tsx:5:27
6:12:34 PM: Type error: Cannot find module ‘react-day-picker’ or its corresponding type declarations.
6:12:34 PM: 3 | import * as React from ‘react’;
6:12:34 PM: 4 | import { ChevronLeft, ChevronRight } from ‘lucide-react’;
6:12:34 PM: > 5 | import { DayPicker } from ‘react-day-picker’;

It’s very clear…
The code in ./components/ui/calendar.tsx
On line 5
Tries to import { DayPicker }
From react-day-picker
It cannot find react-day-picker

This is an error.
It cannot build successfully without that dependency.

As the issue is likely unrelated to Netlify, it’s “out of scope” for assistance here.
https://www.netlify.com/support-scope

Base functionality of Netlify’s build and deploy pipeline is supported, but we cannot help you debug any source code used either during build or after deployment.

You’ll just need to check your project files, and make sure everything is correct.
Ensure your dependencies are defined, can be accessed and are being installed etc.


I’m not sure what you mean.

Since this is Netlify’s forum, you won’t be able to get assistance with Bolt here.
You would need to seek assistance with that from Bolt directly:
https://support.bolt.new/faqs/support


./components/ui/accordion.tsx:4:37
Type error: Cannot find module ‘@radix-ui/react-accordion’ or its corresponding type declarations.

2 |
3 | import * as React from ‘react’;

> 4 | import * as AccordionPrimitive from ‘@radix-ui/react-accordion’;

This is precisely the same type of issue as the other one above.

The code in ./components/ui/accordion.tsx
On line 4
Tries to import * as AccordionPrimitive
From react-day-picker
It cannot find @radix-ui/react-accordion


I’m not sure what ‘fix’ you are referring to.