Skip to content

[Asset] Update the error message when assets are not built #45669

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

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

javiereguiluz
Copy link
Member

Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

The current error message is very precise about what happened, but not very helpful about how to solve it. I propose to improve this using the same "Did you forget ...?" pattern used in other Symfony errors.

@@ -54,7 +54,7 @@ private function getManifestPath(string $path): ?string
{
if (null === $this->manifestData) {
if (!file_exists($this->manifestPath)) {
throw new \RuntimeException(sprintf('Asset manifest file "%s" does not exist.', $this->manifestPath));
throw new \RuntimeException(sprintf('Asset manifest file "%s" does not exist. Did you forget to build the assets with npm or yarn?', $this->manifestPath));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the npm and yarn are to much
Build the frontend assets could be enough imho

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure because if we only display this --> "Did you forget to build the assets?" Many newcomers might think this is a problem to be solved in Symfony ... if we add the brief mention to "yarn" and "npm", they'll get an additional clue about how to solve this or how to better look for a solution for this.

@nicolas-grekas
Copy link
Member

Thank you @javiereguiluz.

@nicolas-grekas nicolas-grekas merged commit 0df1764 into symfony:4.4 Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants