Skip to content

Conversation

Abilovv599
Copy link

some d.ts files will generate after build. type-check fails when those files aren't generated. That is why we should build first.

some d.ts files will generate after build. type-check fails when those files aren't generated. That is why we should build first
@Abilovv599 Abilovv599 changed the title Update build command in package.json fix: Correct "build" command in package.json Sep 5, 2025
Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run-p runs the tasks in parallel no? So it shouldn't matter in which order they are declared.

Could you provide a repro where the current command fails?

Also note that with your change the arguments of npm run build will now be forwarded to type-check instead of build ({@}).

@Abilovv599
Copy link
Author

Hi, I’m using Nuxt UI, and I noticed that auto-imports.d.ts and components.d.ts are generated at build time. The documentation recommends adding these files to .gitignore. However, I couldn’t reproduce the same issue locally. I think the difference is that in the real repository, I have many more components, so it takes longer to generate those files.

@cexbrayat
Copy link
Member

My point is that run-p runs the tasks in parallel, so it shouldn't matter if the tasks are declared in another order.
But if that solves your issue, that's great

@cexbrayat cexbrayat closed this Sep 8, 2025
@Abilovv599
Copy link
Author

If you say so, why are you closed pr?

@skirtles-code
Copy link
Contributor

Based on your description, it seems that there is some kind of race condition within your build. Without a reproduction it isn't clear exactly what that race condition is, but changing the order of tasks run by run-p is unlikely to be a reliable solution.

run-p runs tasks in parallel. The exact timing of each job is not guaranteed. Changing the order may make some subtle difference to the timing of the build, but that likely won't be consistent as the project grows, or on other computers running the same build.

If you need a specific order for those two commands then you probably shouldn't be using run-p at all. Using run-s might be more appropriate.

The current build command works correctly for the project scaffolded by the tool. It's normal to need to tweak the build to fit a specific project. Currently it isn't clear that changing the order of the tasks is justified in the general case, even if it's needed for your specific project.

@Abilovv599
Copy link
Author

Abilovv599 commented Sep 8, 2025

@skirtles-code After couple tries even changing order wouldn't help. Like you said I should use run-s. Thank you for answer!

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

Successfully merging this pull request may close these issues.

3 participants