You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on this project being migrated to Greenwood a run into a number of issues with certain frontmatter content blowing up SSR pages, as it was breaking the JSON.stringify call that happens in SSR pages, that allows the graph to be inlined.
Cases found
Apostrophes
This breaks at build / bundle time for the SSR page
---title: The thing's that happened to me---
Error [RollupError]: Expression expected
at getRollupError (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
at convertProgram (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/parseAst.js:1084:26)
at Object.parseAst [as parse] (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/parseAst.js:2069:87)
at Object.transform (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/@[email protected]/node_modules/@greenwood/cli/src/config/rollup.config.js:284:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async transform (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19663:16)
at async ModuleLoader.addModuleSource (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19879:36) {
code: 'PLUGIN_ERROR',
pos: 717,
pluginCode: 'PARSE_ERROR',
plugin: 'greenwood-import-meta-url',
hook: 'transform',
id: '/Users/owenbuckley/Workspace/github/greenwood-lit-ssr/.greenwood/products.ts'
}
SyntaxError [Error]: Unexpected token m in JSON at position 151
at JSON.parse ()
at handler (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/public/products.route.js:9731:30)
at executeModule (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/@[email protected]/node_modules/@greenwood/cli/src/lib/ssr-route-worker-isolation-mode.js:6:26)
at async MessagePort. (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/@[email protected]/node_modules/@greenwood/cli/src/lib/ssr-route-worker-isolation-mode.js:13:3)
Line Breaks
This happens at runtime on load of an SSR page
---title: | Foo, Bar, Baz
SyntaxError [Error]: Unexpected token
in JSON at position 62
at JSON.parse ()
at handler (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/public/products.route.js:9731:30)
at executeModule (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/@[email protected]/node_modules/@greenwood/cli/src/lib/ssr-route-worker-isolation-mode.js:6:26)
at async MessagePort. (file:///Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/.pnpm/@[email protected]/node_modules/@greenwood/cli/src/lib/ssr-route-worker-isolation-mode.js:13:3)
Nested Frontmatter
Hmm, can not reproduce in isolation?
---sidebar:
order: 1---
---
<!-- but this works -->
sidebar:
- order: 1
---
Details
For a few of these, I'm not sure if the syntax is valid, or would otherwise have to figure out how they are parsed
line breaks, e.g. title
nested frontmatter
I also wonder if we should also be calling pruneGraph in these cases as well?
The text was updated successfully, but these errors were encountered:
Type of Change
Bug
Summary
Working on this project being migrated to Greenwood a run into a number of issues with certain frontmatter content blowing up SSR pages, as it was breaking the
JSON.stringify
call that happens in SSR pages, that allows the graph to be inlined.Cases found
Apostrophes
This breaks at build / bundle time for the SSR page
Double Quotes in Frontmatter Imports
This happens at runtime on load of an SSR page
Line Breaks
This happens at runtime on load of an SSR page
Nested Frontmatter
Details
For a few of these, I'm not sure if the syntax is valid, or would otherwise have to figure out how they are parsed
I also wonder if we should also be calling
pruneGraph
in these cases as well?The text was updated successfully, but these errors were encountered: