Facing issue while deploying project on Netlify at building getting failed [closed]

i have a project and i have hosted it netlify at begining its working fine and later some days i have added more content in website and again pushed the code into github and automatically netlify project is also will update the code and will show but its not showing and after adding some more data when i look in to netlify its getting building failed i don’t know what’s going on i tried to solve all the way posible and corrected all the errors but its again showing the same problem below im pasting the error what it’s saying i have tried all those things once check it out.

Diagnosis:

In the build logs at line 88, it mentions a type error related to the default export in the file “app/destinationApi/page.js”. The error specifies that the type “{ destination: any; }” is not valid.

Solution:

To resolve this error, you need to ensure that the default export in “app/destinationApi/page.js” conforms to the correct type. Update the default export in that file to the appropriate type to fix this issue.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>12:39:41 PM: Netlify Build
12:39:41 PM: ────────────────────────────────────────────────────────────────
12:39:41 PM: ​
12:39:41 PM: ❯ Version
12:39:41 PM: @netlify/build 29.50.5
12:39:41 PM: ​
12:39:41 PM: ❯ Flags
12:39:41 PM: baseRelDir: true
12:39:41 PM: buildId: 6694ca7a2cfa680d0cd8e682
12:39:41 PM: deployId: 6694ca7a2cfa680d0cd8e684
12:39:41 PM: ​
12:39:41 PM: ❯ Current directory
12:39:41 PM: /opt/build/repo
12:39:41 PM: ​
12:39:41 PM: ❯ Config file
12:39:41 PM: No config file was defined: using default values.
12:39:41 PM: ​
12:39:41 PM: ❯ Context
12:39:41 PM: production
12:39:42 PM: ​
12:39:42 PM: ❯ Using Next.js Runtime - v5.5.1
12:39:43 PM: No Next.js cache to restore
12:39:43 PM: ​
12:39:43 PM: Build command from Netlify app
12:39:43 PM: ────────────────────────────────────────────────────────────────
12:39:43 PM: ​
12:39:43 PM: $ npm run build
12:39:43 PM: > [email protected] build
12:39:43 PM: > next build
12:39:44 PM: ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
12:39:44 PM: ▲ Next.js 14.2.5
12:39:44 PM: Creating an optimized production build ...
12:39:46 PM: ⚠ For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization.
12:39:46 PM: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
12:39:57 PM: ⚠ For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization.
12:39:57 PM: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
12:40:05 PM: ✓ Compiled successfully
12:40:05 PM: Linting and checking validity of types ...
12:40:07 PM: Failed to compile.
12:40:07 PM:
12:40:07 PM: app/destinationApi/page.js
12:40:07 PM: Type error: Page "app/destinationApi/page.js" has an invalid "default" export:
12:40:07 PM: Type "{ destination: any; }" is not valid.
12:40:07 PM: ​
12:40:07 PM: "build.command" failed
12:40:07 PM: ────────────────────────────────────────────────────────────────
12:40:07 PM: ​
12:40:07 PM: Error message
12:40:07 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
12:40:07 PM: ​
12:40:07 PM: Error location
12:40:07 PM: In Build command from Netlify app:
12:40:07 PM: npm run build
12:40:07 PM: ​
12:40:07 PM: Resolved config
12:40:07 PM: build:
12:40:07 PM: command: npm run build
12:40:07 PM: commandOrigin: ui
12:40:07 PM: publish: /opt/build/repo/.next
12:40:07 PM: publishOrigin: ui
12:40:07 PM: plugins:
12:40:07 PM: - inputs: {}
12:40:07 PM: origin: ui
12:40:07 PM: package: '@netlify/plugin-nextjs'
12:40:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:40:08 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:40:08 PM: Failing build: Failed to build site
12:40:08 PM: Finished processing build request in 46.303s
</code>
<code>12:39:41 PM: Netlify Build 12:39:41 PM: ──────────────────────────────────────────────────────────────── 12:39:41 PM: ​ 12:39:41 PM: ❯ Version 12:39:41 PM: @netlify/build 29.50.5 12:39:41 PM: ​ 12:39:41 PM: ❯ Flags 12:39:41 PM: baseRelDir: true 12:39:41 PM: buildId: 6694ca7a2cfa680d0cd8e682 12:39:41 PM: deployId: 6694ca7a2cfa680d0cd8e684 12:39:41 PM: ​ 12:39:41 PM: ❯ Current directory 12:39:41 PM: /opt/build/repo 12:39:41 PM: ​ 12:39:41 PM: ❯ Config file 12:39:41 PM: No config file was defined: using default values. 12:39:41 PM: ​ 12:39:41 PM: ❯ Context 12:39:41 PM: production 12:39:42 PM: ​ 12:39:42 PM: ❯ Using Next.js Runtime - v5.5.1 12:39:43 PM: No Next.js cache to restore 12:39:43 PM: ​ 12:39:43 PM: Build command from Netlify app 12:39:43 PM: ──────────────────────────────────────────────────────────────── 12:39:43 PM: ​ 12:39:43 PM: $ npm run build 12:39:43 PM: > [email protected] build 12:39:43 PM: > next build 12:39:44 PM: ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache 12:39:44 PM: ▲ Next.js 14.2.5 12:39:44 PM: Creating an optimized production build ... 12:39:46 PM: ⚠ For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization. 12:39:46 PM: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production 12:39:57 PM: ⚠ For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization. 12:39:57 PM: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production 12:40:05 PM: ✓ Compiled successfully 12:40:05 PM: Linting and checking validity of types ... 12:40:07 PM: Failed to compile. 12:40:07 PM: 12:40:07 PM: app/destinationApi/page.js 12:40:07 PM: Type error: Page "app/destinationApi/page.js" has an invalid "default" export: 12:40:07 PM: Type "{ destination: any; }" is not valid. 12:40:07 PM: ​ 12:40:07 PM: "build.command" failed 12:40:07 PM: ──────────────────────────────────────────────────────────────── 12:40:07 PM: ​ 12:40:07 PM: Error message 12:40:07 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1) 12:40:07 PM: ​ 12:40:07 PM: Error location 12:40:07 PM: In Build command from Netlify app: 12:40:07 PM: npm run build 12:40:07 PM: ​ 12:40:07 PM: Resolved config 12:40:07 PM: build: 12:40:07 PM: command: npm run build 12:40:07 PM: commandOrigin: ui 12:40:07 PM: publish: /opt/build/repo/.next 12:40:07 PM: publishOrigin: ui 12:40:07 PM: plugins: 12:40:07 PM: - inputs: {} 12:40:07 PM: origin: ui 12:40:07 PM: package: '@netlify/plugin-nextjs' 12:40:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 12:40:08 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2) 12:40:08 PM: Failing build: Failed to build site 12:40:08 PM: Finished processing build request in 46.303s </code>
12:39:41 PM: Netlify Build                                                 
12:39:41 PM: ────────────────────────────────────────────────────────────────
12:39:41 PM: ​
12:39:41 PM: ❯ Version
12:39:41 PM:   @netlify/build 29.50.5
12:39:41 PM: ​
12:39:41 PM: ❯ Flags
12:39:41 PM:   baseRelDir: true
12:39:41 PM:   buildId: 6694ca7a2cfa680d0cd8e682
12:39:41 PM:   deployId: 6694ca7a2cfa680d0cd8e684
12:39:41 PM: ​
12:39:41 PM: ❯ Current directory
12:39:41 PM:   /opt/build/repo
12:39:41 PM: ​
12:39:41 PM: ❯ Config file
12:39:41 PM:   No config file was defined: using default values.
12:39:41 PM: ​
12:39:41 PM: ❯ Context
12:39:41 PM:   production
12:39:42 PM: ​
12:39:42 PM: ❯ Using Next.js Runtime - v5.5.1
12:39:43 PM: No Next.js cache to restore
12:39:43 PM: ​
12:39:43 PM: Build command from Netlify app                                
12:39:43 PM: ────────────────────────────────────────────────────────────────
12:39:43 PM: ​
12:39:43 PM: $ npm run build
12:39:43 PM: > [email protected] build
12:39:43 PM: > next build
12:39:44 PM: ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
12:39:44 PM:   ▲ Next.js 14.2.5
12:39:44 PM:    Creating an optimized production build ...
12:39:46 PM:  ⚠ For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization.
12:39:46 PM: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
12:39:57 PM:  ⚠ For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization.
12:39:57 PM: Read more: https://nextjs.org/docs/messages/sharp-missing-in-production
12:40:05 PM:  ✓ Compiled successfully
12:40:05 PM:    Linting and checking validity of types ...
12:40:07 PM: Failed to compile.
12:40:07 PM: 
12:40:07 PM: app/destinationApi/page.js
12:40:07 PM: Type error: Page "app/destinationApi/page.js" has an invalid "default" export:
12:40:07 PM:   Type "{ destination: any; }" is not valid.
12:40:07 PM: ​
12:40:07 PM: "build.command" failed                                        
12:40:07 PM: ────────────────────────────────────────────────────────────────
12:40:07 PM: ​
12:40:07 PM:   Error message
12:40:07 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
12:40:07 PM: ​
12:40:07 PM:   Error location
12:40:07 PM:   In Build command from Netlify app:
12:40:07 PM:   npm run build
12:40:07 PM: ​
12:40:07 PM:   Resolved config
12:40:07 PM:   build:
12:40:07 PM:     command: npm run build
12:40:07 PM:     commandOrigin: ui
12:40:07 PM:     publish: /opt/build/repo/.next
12:40:07 PM:     publishOrigin: ui
12:40:07 PM:   plugins:
12:40:07 PM:     - inputs: {}
12:40:07 PM:       origin: ui
12:40:07 PM:       package: '@netlify/plugin-nextjs'
12:40:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:40:08 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:40:08 PM: Failing build: Failed to build site
12:40:08 PM: Finished processing build request in 46.303s

I have tried many things like installing packages and changed the import and export lines but not working and i want to fix this issue and i can able to host the project again without any problem.

New contributor

Mohammed Zaheer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật