Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c1bcf02ed | |||
| 3cd0ec4d87 | |||
| b7bfc8750e | |||
| 0d512a40d0 | |||
| b15ff40740 | |||
| fdc2354ccc |
@@ -9,6 +9,9 @@
|
|||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
"include": [
|
||||||
|
"src/**/*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true
|
"recommended": true
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "blog-astro",
|
"name": "blog-astro",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.1",
|
"version": "0.0.3",
|
||||||
|
"packageManager": "pnpm@9.7.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: @astrojs/node Build Error
|
title: "@astrojs/node Build Error"
|
||||||
date: 2024-11-23
|
date: 2024-11-23
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
title: "Content Frontmatter Causes `astro build` Error?"
|
||||||
|
date: 2024-11-24
|
||||||
|
---
|
||||||
|
|
||||||
|
Another entry for this site. I ran `pnpm run build` after adding yesterday's entry, and got this error:
|
||||||
|
|
||||||
|
```
|
||||||
|
✘ [ERROR] The build was canceled
|
||||||
|
|
||||||
|
end of the stream or a document separator is expected
|
||||||
|
Hint:
|
||||||
|
Browser APIs are not available on the server.
|
||||||
|
|
||||||
|
If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.
|
||||||
|
|
||||||
|
See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.
|
||||||
|
|
||||||
|
Location:
|
||||||
|
/home/avraham/sakal.us/blog-astro/src/content/journal-entries/2024-11-23.md:1:7
|
||||||
|
Stack trace:
|
||||||
|
at generateError (/home/avraham/sakal.us/blog-astro/node_modules/.pnpm/js-yaml@3.14.1/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
|
||||||
|
at readDocument (/home/avraham/sakal.us/blog-astro/node_modules/.pnpm/js-yaml@3.14.1/node_modules/js-yaml/lib/js-yaml/loader.js:1545:5)
|
||||||
|
at load (/home/avraham/sakal.us/blog-astro/node_modules/.pnpm/js-yaml@3.14.1/node_modules/js-yaml/lib/js-yaml/loader.js:1614:19)
|
||||||
|
at module.exports (/home/avraham/sakal.us/blog-astro/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.js:12:17)
|
||||||
|
at matter (/home/avraham/sakal.us/blog-astro/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js:50:10)
|
||||||
|
ELIFECYCLE Command failed with exit code 1.
|
||||||
|
```
|
||||||
|
|
||||||
|
I was obviously not using Browser APIs in an `.md` file. But, it did report that file as the culprit (specifically, the first line), so I checked it out.
|
||||||
|
|
||||||
|
```md
|
||||||
|
---
|
||||||
|
title: @astrojs/node Build Error
|
||||||
|
date: 2024-11-23
|
||||||
|
---
|
||||||
|
|
||||||
|
<... rest of the file...>
|
||||||
|
```
|
||||||
|
|
||||||
|
I noticed the `@` was a different color than the rest of the line. I thought YAML interprets any non-digit character as the start of a string; but just in case I wrapped the line in quotes, and it worked!
|
||||||
|
|
||||||
|
```md
|
||||||
|
---
|
||||||
|
title: "@astrojs/node Build Error"
|
||||||
|
date: 2024-11-23
|
||||||
|
---
|
||||||
|
|
||||||
|
<... rest of the file...>
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user