tailwind
tailwind copied to clipboard
cant ng build because => "Error: Unexpected '/'. Escaping special characters with \ may help."
I am trying to ng serve --prod
but i get an error.
Error: Unexpected '/'. Escaping special characters with \ may help.
Looking online. It seems to be an issue with escaping \
when using @apply
(example => @apply text-8\/2 font-bold;
)
However — i don't have any @apply
s that use \
. Also when i use @apply vscode gives me syntax errors despite using postcss language support
semi-colon expectedscss(css-semicolonexpected)
"@ngneat/tailwind": "^7.0.3", "@angular/cli": "12.0.0", "@nrwl/cli": "12.3.4", "@nrwl/cypress": "12.3.4", "@nrwl/eslint-plugin-nx": "12.3.4", "@nrwl/jest": "12.3.4", "@nrwl/linter": "12.3.4", "@nrwl/nx-cloud": "latest", "@nrwl/storybook": "^12.3.4", "@nrwl/tao": "12.3.4", "@nrwl/workspace": "12.3.4",
@ohabash Any updates on it? I'm getting the same error and I have no clue at all of what is going on. I'm getting it when I try to build using --prod flag, and it started happening after I upgraded to Angular 12.
*ps: The file D:\Code\Airbox\frontend\styles.db88f49885480a545f73.css:9031:1 does not exist, it somehow is created and read by the build --prod command.
ng build (without --prod) and ng serve are working properly.
I could find a work around and posted it here on stack overflow. I hope it helps someone.
I am facing the same problem, any solution found?
Did someone found the root cause? let me know if you found any clue?
@Jackeysharath my problem was resolved, it was not related to tailwin, it was due to */ comment which was not completed. the angular compiler doesn't look for errors in the CSS declarations so it doesn't show compile errors.
@rohittidke Thank you, I went to look through my files and realized that my css file has an uncompleted */ comment, hence this error message surfaced.
It was really hard for me to find the solution, in my case it was because I had a comment into the scss file like this using "//comment" instead of "/comment/"
same issue with my code. Fixed by converting //comments to /* comments */
ran into same issue, and @danielarevalo100 suggestion fixed it - had to convert // comment
to /* comment*/
@Jackeysharath This really helped.... for a comment typo i wasted like hours
Same issue today with react, after debugging more than an hour I deleted the module file and reinstalled the packages again, which solved the problem for me.