I’m following the book “Phoenix web development” and in the lesson “passing data to the templates” I followed each step as in the book, and double checked, but I’m still getting the error expected a path starting with a single / but got " /css/app.css "
.
It looks like problem with the framework, not with my code.
Your path has a space in front and at the end, you need to remove them.
I think I saw this issue at least couple times recently - it seems there’s some VSCode extension inserting spaces all over the place. I don’t remember which one exactly it was, though.
I wasn’t able to find the problem, so I re-ran npm install && node node_modules/brunch/bin/brunch build
and also re-created the controller and template files and the error got fixed.
I didn’t check step-by-step, so I don’t know if the error was with the template file or the npm/brunch.
Yes, I appended a space, then prepended a space, in both cases it will give the same error.
And as @michalmuskala said, it might be some extension automatically inserting the spaces in paths to CSS, but it was the first time I faced this problem.