Skip to content

How to fix the "Parse failure: Unterminated string constant" error

The Valley of Code

Your Web Development Manual

I ran into this error with a student of mine, running Astro on Windows (could not replicate on macOS), after running npm run dev.

After much πŸ€” we solved by renaming the parent folder, which apparently had a strange character, perhaps non-ASCII.

If you run into this problem, try renaming the folder you are running (or perhaps a parent folder in the path) to just ASCII text, like β€œtest”

β†’ Get my JavaScript Beginner's Handbook
β†’ Read my JavaScript Tutorials on The Valley of Code
β†’ Read my TypeScript Tutorial on The Valley of Code
  • THE VALLEY OF CODE (+ PRO), your web development manual
  • I wrote 15+ free coding BOOKS, download them here
  • SOLOPRENEUR LAND the missing MBA for wannabe solopreneurs craving a life with more freedom, control, fulfillment and purpose (summer 2024)