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

The nuxi preview command does not work with the custom nitro.output setting #418

Closed
alSergey opened this issue May 13, 2024 · 3 comments
Closed

Comments

@alSergey
Copy link

alSergey commented May 13, 2024

Environment

  • Operating System: Darwin
  • Node Version: v20.13.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.5.2
  • Builder: -
  • User Config: devtools, nitro
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. git clone git@github.com:alSergey/nuxi-start-repro.git
  2. Run command npm run build_and_start

Describe the bug

The nuxi preview command doesn't run because it expects an .output folder. As I understand it, the problem is in this lines

const defaultOutput = resolve(cwd, '.output', 'nitro.json') // for backwards compatibility
const nitroJSONPaths = [resolvedOutputDir, defaultOutput]
const nitroJSONPath = nitroJSONPaths.find((p) => existsSync(p))
if (!nitroJSONPath) {
consola.error(
'Cannot find `nitro.json`. Did you run `nuxi build` first? Search path:\n',
nitroJSONPaths,
)
process.exit(1)
}

Additional context

No response

Logs

> nuxt preview

 ERROR  Cannot find nitro.json. Did you run nuxi build first? Search path:                                                                                                                                  20:12:34
 [ '/Users/seralekhin/Desktop/nuxi-start-repro/server/dist/nitro.json',
  '/Users/seralekhin/Desktop/nuxi-start-repro/.output/nitro.json' ]
@danielroe danielroe transferred this issue from nuxt/nuxt May 24, 2024
@alSergey
Copy link
Author

Hello, could you please tell me the status of this issue?

@Neemsigo
Copy link

Have the same problem. Looks like the .output dir is hardcoded. Can't use preview|start command with custom output dir name now :(
Do you have plans for fix this?

@pi0
Copy link
Member

pi0 commented May 30, 2024

Hi. The issue should be solved via nightly release channel. (#376)

@pi0 pi0 closed this as completed May 30, 2024
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

3 participants