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

Error: Could not find a production build in the '/home/ubuntu/cal.com/apps/web/.next', works on yarn dev #4948

Closed
CodingRockz opened this issue Oct 11, 2022 · 7 comments

Comments

@CodingRockz
Copy link

Found a bug? Please fill out the sections below. 👍

Issue Summary

A summary of the issue. This needs to be a clear detailed-rich summary.

Steps to Reproduce

  1. Self hosted install of latest build
  2. yarn and yarn build
  3. yarn dev works fine
  4. yarn start - gives the below error and exits

Error: Could not find a production build in the '/home/ubuntu/cal.com/apps/web/.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
@calcom/web:start: at NextNodeServer.getBuildId (/home/ubuntu/cal.com/node_modules/next/dist/server/next-server.js:116:23)
@calcom/web:start: at new Server (/home/ubuntu/cal.com/node_modules/next/dist/server/base-server.js:70:29)
@calcom/web:start: at new NextNodeServer (/home/ubuntu/cal.com/node_modules/next/dist/server/next-server.js:63:9)
@calcom/web:start: at NextServer.createServer (/home/ubuntu/cal.com/node_modules/next/dist/server/next.js:140:16)
@calcom/web:start: at async /home/ubuntu/cal.com/node_modules/next/dist/server/next.js:149:31
@calcom/web:start: error Command failed with exit code 1.
@calcom/web:start: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@calcom/web:start: ERROR: command finished with error: command (apps/web) yarn run start exited (1)
command (apps/web) yarn run start exited (1)

@emrysal
Copy link
Contributor

emrysal commented Oct 11, 2022

I think this happens due to the order. yarn build (also make sure this succeeds) builds the repo, but yarn dev clears out the .next folder. So if you run yarn dev after building it clears out your build.

try yarn build && yarn start?

@CodingRockz
Copy link
Author

try yarn build && yarn start?

Will give this a try and let you know. But when i did this previously using the order you suggest, i got TypeError: Cannot use 'in' operator to search for 'viewer.public.i18n' in undefined and hence why i tried the dev option and noticed it worked find with dev and only failed when building production

@CodingRockz
Copy link
Author

CodingRockz commented Oct 12, 2022

Update:

Exact same issue with your sequence

@calcom/web:start: Error: Could not find a production build in the '/home/ubuntu /cal.com/apps/web/.next' directory. Try building your app with 'next build' befo re starting the production server. https://nextjs.org/docs/messages/production-s tart-no-build-id
@calcom/web:start: at NextNodeServer.getBuildId (/home/ubuntu/cal.com/node_m odules/next/dist/server/next-server.js:116:23)
@calcom/web:start: at new Server (/home/ubuntu/cal.com/node_modules/next/dis t/server/base-server.js:70:29)
@calcom/web:start: at new NextNodeServer (/home/ubuntu/cal.com/node_modules/ next/dist/server/next-server.js:63:9)
@calcom/web:start: at NextServer.createServer (/home/ubuntu/cal.com/node_mod ules/next/dist/server/next.js:140:16)
@calcom/web:start: at async /home/ubuntu/cal.com/node_modules/next/dist/serv er/next.js:149:31
@calcom/web:start: error Command failed with exit code 1.
@calcom/web:start: info Visit https://yarnpkg.com/en/docs/cli/run for documentat ion about this command.
@calcom/web:start: ERROR: command finished with error: command (apps/web) yarn r un start exited (1)
command (apps/web) yarn run start exited (1)

Tasks: 1 successful, 2 total
Cached: 0 cached, 2 total
Time: 3.684s

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm and.

Builds and says succesful, but when using yarn start it fails as above.

@Denniskamau
Copy link

Experiencing the same issue with the latest release.Any idea on how to fix this. Thanks.

@Denniskamau
Copy link

@CoffeeFlux
Copy link

Sorry, but does anyone know what was in that discussion page? Running into the same issue :)

@carlosrojas
Copy link

carlosrojas commented Aug 2, 2023

I am not sure if this is what solved it for me, but I updated apps/web/next.config.js to have

module.exports = {
  typescript: {
    // !! WARN !!
    // Dangerously allow production builds to successfully complete even if
    // your project has type errors.
    // !! WARN !!
    ignoreBuildErrors: true,
  },
}

https://nextjs.org/docs/pages/api-reference/next-config-js/typescript

I read somewhere that you just need to ignore type errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants