Octal literal in strict mode with markdown images #8454
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: assets
Related to the Assets feature (scope)
feat: markdown
Related to Markdown (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
From support discussion: https://discord.com/channels/830184174198718474/1149037613961977906
When a markdown document references an image that it cannot find but the past to that image has numbers in it then instead or saying the file can't be found the error returned is similar to below:
Parse failure: Octal literal in strict mode (9:130)
At file: E:/Dev/snape.me/src/content/posts/2009/04/using-integration-services-to-populate-a-date-dimension.md
Contents of line 9: 'image_3.png': await getImageSafely((await import("image_3.png")).default, "image_3.png", "/E:\Dev\snape.me\src\content\posts\2009\04\image_3.png")
Is cause by the following in the .md file:
But if I change it to:
Then the page loads correctly.
This only happens on Windows.
When I run it in https://codesandbox.io/ then the error message is (far easier to understand):
Cannot find module 'image_3.png' imported from '/workspace/src/content/posts/2009/04/using-integration-services-to-populate-a-date-dimension.md'
What's the expected result?
Expected result is that the error message is easy to debug like the Linux version above.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-i55tcq?file=src%2Fcontent%2Fblog%2F2023%2F09%2Fbroken-image.md
Participation
The text was updated successfully, but these errors were encountered: