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

If the title of a post contains a colon(:), src/pages/[ogTitle].svg.ts and then src/utils/generateOgImage.tsx fails on npm run build with src/utils/generateOgImage.tsx #88

Closed
mofrisch opened this issue Jul 9, 2023 · 1 comment

Comments

@mofrisch
Copy link

mofrisch commented Jul 9, 2023

Minimal not working example:
Make a post with title: "Finally: My first blog post".
set ogImage: ""

npm run build

λ src/pages/[ogTitle].svg.ts
Output PNG Image : Adding new posts in AstroPaper theme.png
├─ /Adding new posts in AstroPaper theme.svg (+203ms)
Output PNG Image : Finally: My first blog post.png
error The URL must be of scheme file
File:
/Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/generate.js:493:21
Code:
492 | await fs.promises.mkdir(outFolder, { recursive: true });
> 493 | await fs.promises.writeFile(outFile, body, encoding ?? "utf-8");
| ^
494 | }
495 | export {
496 | chunkIsPage,
Stacktrace:
TypeError: The URL must be of scheme file
at open (node:internal/fs/promises:591:10)
at Object.writeFile (node:internal/fs/promises:1017:20)
at generatePath (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/generate.js:493:21)
at async generatePage (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/generate.js:193:5)
at async generatePages (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/generate.js:118:7)
at async staticBuild (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/static-build.js:85:7)
at async AstroBuilder.build (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/index.js:124:5)
at async AstroBuilder.run (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/index.js:156:7)
at async build (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/core/build/index.js:37:3)
at async runCommand (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/cli/index.js:171:14)
at async cli (file:///Users/mo/dev/moritz-blogs/node_modules/astro/dist/cli/index.js:213:5)

satnaing added a commit that referenced this issue Sep 15, 2023
Update the implementation of og image generation code to allow special character usage in title.

fix #103, fix #88
@satnaing
Copy link
Owner

This bug is going to be solved in AstroPaper v3.

tanishqmanuja pushed a commit to tanishqmanuja/blog that referenced this issue Sep 16, 2023
Update the implementation of og image generation code to allow special character usage in title.

fix satnaing#103, fix satnaing#88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants