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

Static builds stops at generating static routes without error when using optimized images #8547

Closed
1 task
BryceRussell opened this issue Sep 13, 2023 · 7 comments · Fixed by #8598
Closed
1 task
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: assets Related to the Assets feature (scope) feat: markdown Related to Markdown (scope)

Comments

@BryceRussell
Copy link
Member

BryceRussell commented Sep 13, 2023

Astro Info

(stackblitz minimal reproduction)
Astro                    v3.0.8
Node                     v16.20.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

In some cases, when using optimized images, astro build will stop/fail at the generating static route stage and not throw any errors making production builds appear as if they were successful

Cases:

  1. Support Thread | Example Repo
    • Breaks when using an inline relative image path in markdown
  2. Support Thread | Example | Minimal Reproduction
    • Breaks when using an inline relative image path in markdown to asset in /public
  3. Support Thread | Github Pages Example | Minimal Reproduction (Stackblitz) | Minimal Reproduction v2
    • Breaks when using an inline relative image path in markdown located in /src/pages
  4. Support Thread | Example Repo
    • Breaks when using import.meta.glob() to glob markdown containing inline relative image paths
  5. Support Thread | Example
    • Breaks when importing a .md file with inline relative image paths
  6. Support Thread | Example
    • Breaks when exporting result of getImage() in .astro file

All cases are using v3 optimized images, 5/6 of them are using inline relative image paths in markdown.

Example of broken output:

image

What's the expected result?

Build should throw an error or continue building

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-threhe?file=src%2Fpages%2Findex.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 13, 2023
@Pocee
Copy link

Pocee commented Sep 13, 2023

<3

@lilnasy lilnasy added - P4: important Violate documented behavior or significantly impacts performance (priority) feat: assets Related to the Assets feature (scope) and removed needs triage Issue needs to be triaged labels Sep 14, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Sep 14, 2023

Maybe a p5, not sure how widely it affects users.

@lilnasy
Copy link
Contributor

lilnasy commented Sep 14, 2023

Another instance encountered by @webpro.

Thread | Repo

  • Breaks when import.meta.glob is called for content pages, unclear which markdown file is the cause.

@lilnasy lilnasy added the feat: markdown Related to Markdown (scope) label Sep 14, 2023
@BryceRussell
Copy link
Member Author

BryceRussell commented Sep 15, 2023

Another instance encountered by @webpro.

Thread | Repo

  • Breaks when import.meta.glob is called for content pages, unclear which markdown file is the cause.

Confirmed that this is the same issue, I removed all relative image paths in the markdown from /src/content and the build completed successfully. I will add it to the list of cases above

@Princesseuh
Copy link
Member

I'll take a look, thank you for all the reproductions!

@webpro
Copy link
Contributor

webpro commented Sep 19, 2023

Just a quick note I thought I might have introduced this bug myself in #8475 (released as part of v3.1.0), but this issue is reported based on v3.0.8.

@Princesseuh
Copy link
Member

So investigating this...

This line is the line that crashes the process:

const pageModule = await pageModulePromise();

Why? Well, I actually don't know. The module it's trying to load typically looks like this:

export { renderers } from '../renderers.mjs';
export { onRequest } from '../_empty-middleware.mjs';

const page = () => import('../chunks/pages/index_91945e29.mjs').then(n => n.i);

export { page };

and running the debugger through it, after line 4, the process just ends after going through some Node code, no exceptions or messages. I'll keep investigating, but so far I'm lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (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.

5 participants