Skip to content
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

Octal literal in strict mode with markdown images #8454

Closed
1 task
jsnape opened this issue Sep 7, 2023 · 0 comments · Fixed by #8598
Closed
1 task

Octal literal in strict mode with markdown images #8454

jsnape opened this issue Sep 7, 2023 · 0 comments · Fixed by #8598
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)

Comments

@jsnape
Copy link

jsnape commented Sep 7, 2023

Astro Info

Astro                    v3.0.10
Node                     v18.17.1
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/mdx

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:

![Script Component Type](image_3.png)

But if I change it to:

![Script Component Type](./image_3.png)

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

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 7, 2023
@natemoo-re natemoo-re added feat: assets Related to the Assets feature (scope) feat: markdown Related to Markdown (scope) - P3: minor bug An edge case that only affects very specific usage (priority) labels Sep 7, 2023
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants