calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
29.81k stars 6.99k forks source link

Export encountered errors on following paths: #14457

Open mhemon opened 2 months ago

mhemon commented 2 months ago

Hello Everyone, I have faced some problems on yarn build it says Export encountered errors on the following paths: @calcom/web:build: /favicon.ico/route: /favicon.ico

Here is the command line output:- @calcom/web:build: @calcom/web:build: > Export encountered errors on the following paths: @calcom/web:build: /favicon.ico/route: /favicon.ico @calcom/web:build: ERROR: command finished with error: command (G:\Project\Work\cal.com\apps\web) C:\Users\User\AppData\Local\Temp\xfs-c04a550a\yarn.cmd run build exited (1) @calcom/web#build: command (G:\Project\Work\cal.com\apps\web) C:\Users\User\AppData\Local\Temp\xfs-c04a550a\yarn.cmd run build exited (1)

Tasks: 6 successful, 7 total Cached: 2 cached, 7 total Time: 3m3.386s Failed: @calcom/web#build

ERROR run failed: command exited (1)

dosubot[bot] commented 2 months ago

Based on the error message you provided, it seems like the build process is encountering issues when trying to export the /favicon.ico path. Here are some general steps you can take to troubleshoot and potentially resolve this issue:

  1. Ensure the Favicon Exists: Make sure that the favicon.ico file is located in the public folder at the root of your Next.js project. The public folder is where static files should be placed in Next.js.

  2. Check for Typos or Path Issues: Verify that there are no typos in the file name and that the path referenced in your HTML or JSX files is correct. The standard path for the favicon in a Next.js project would be /favicon.ico if placed directly inside the public folder.

  3. Review Custom Webpack Configuration: Since your project uses a custom Webpack configuration, ensure that there are no configurations inadvertently affecting the handling or path of static assets like the favicon. For example, ensure that CopyWebpackPlugin is not misconfigured to exclude or incorrectly handle the favicon file.

  4. Check for Server-Side Configurations: If your project includes custom server-side configurations or rewrites that might affect the serving of static files, review those to ensure they are not interfering with the serving of the favicon.

  5. Build and Export Logs: Since the issue occurs during the build process, carefully review the build and export logs for any warnings or errors specifically mentioning the favicon or static assets. This can provide clues to the underlying issue.

Without specific error messages or a detailed description of how the favicon is being handled in the project, these general steps are the best course of action to troubleshoot and potentially resolve the issue.

In your project, the favicon.ico file is not directly referenced within the provided HTML or JSX files. Instead, the project uses different sizes of icons for various purposes, such as for Apple touch icons and different sizes for favicon images in PNG format. The references to favicon-related icons are as follows:

There is no direct mention of a favicon.ico file in the provided context. Instead, the project seems to use an API endpoint (/api/logo?type=) to dynamically serve icons based on the specified type in the query parameter.

In your next.config.js file, there are no custom configurations that directly affect the handling of the favicon.ico file. However, the project does use Next.js rewrites, which can alter how URLs are resolved server-side, potentially impacting the serving of static files. The next.config.js file contains an async rewrites() function that returns a configuration object with beforeFiles and afterFiles arrays. These arrays define custom rewrite rules that can modify the request paths.

Additionally, the project's use of the CopyWebpackPlugin in the webpack configuration could potentially affect how and where favicon.ico or other static assets are served from, depending on the project's structure and requirements.

I hope this helps! If you're still encountering issues, could you provide more details about your project's structure and how you're handling static assets like the favicon? This could help in identifying the root cause of the issue.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
juliamrch commented 2 months ago

I had the same issue, that seemed to originate from the favicon.ico being at the root of /apps/web/app. I created a /public directory in apps/web/app and put favicon.ico in it, build succeeded after that.