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

Default nuxt config missing analyzeDir value #1032

Open
Migushthe2nd opened this issue Dec 23, 2023 · 1 comment
Open

Default nuxt config missing analyzeDir value #1032

Migushthe2nd opened this issue Dec 23, 2023 · 1 comment

Comments

@Migushthe2nd
Copy link

Environment

  • Operating System: Windows_NT
  • Node Version: v18.19.0
  • Nuxt Version: 2.17.2-28284499.5674f49
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: yarn@1.22.19
  • Builder: webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Should be self-explanatory

Describe the bug

Running nuxi analyze results in

ERROR  The "path" argument must be of type string or an instance of Buffer or URL. Received undefined

  at Object.rm (node:internal/fs/promises:722:38)
  at clearDir (node_modules/nuxi/dist/shared/nuxi.976cd438.mjs:11:20)
  at Object.run (node_modules/nuxi/dist/chunks/analyze.mjs:93:11)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11)
  at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7) 

The path here is the analyzeDir property in the nuxt config. This property does not seem to be assigned a default value ("/<rootDir>/.nuxt/analyze" as described in the nuxt docs), nor be resolved for example in the nitro config creation. buildDir is resolved in this case:

dev: nuxt.options.dev,
buildDir: resolve(nuxt.options.buildDir),
scanDirs: nuxt.options._layers.map(layer => join(layer.config.srcDir, 'server')),

Additional context

Nitro enabled, Vite disabled.

When manually providing a value, nuxi analyze runs generates an html report.

    analyzeDir: "./.nuxt/analyze",

However, this default path seems to be conflicting with the 'Starting stats server' step.

Logs

No response

Copy link
Contributor

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v2-bridge
👉 https://codesandbox.io/p/github/nuxt/starter/v2-bridge-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

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

No branches or pull requests

2 participants