Revisions seems to crash building in some situations #12

Open
opened 2023-10-19 16:01:15 +00:00 by xrdawson · 0 comments
xrdawson commented 2023-10-19 16:01:15 +00:00 (Migrated from extrastatic.dev)

With this in my _config.yml:

...
revisions:
  enabled: true
  message: true
  full: true
...

I see this crash (ParseError: Unterminated string constant):

(I believe this is probably that the diffs hash is not correctly converting/escaping the diff and when that is inserted into the pre-compiled template, the svelte compiler crashes.)

The temporary fix is to disabled revisions for now.

$ node $(which yarn) build
yarn run v1.22.10
warning package.json: No license field
$ yarn svekyll-cli build && yarn svekyll-cli finalize
warning package.json: No license field
$ /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/.bin/svekyll-cli build
  NOTICE:  No blog roll found, skipping Error: ENOENT: no such file or directory, open './blogs.json'
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
  NOTICE:  Unable to find local index.html, loading from node modules
  NOTICE:  Unable to find local src/Index.svelte, loading from node modules
  NOTICE:  Unable to find local src/Page.svelte, loading from node modules
  NOTICE:  Unable to find local src/index.html, loading from node modules
  NOTICE:  Unable to find local svekyll/svekyll.css, loading from node modules
10/19/2023, 11:59:05 AM  Found 410 candidates
10/19/2023, 11:59:05 AM  Generated files 101
10/19/2023, 11:59:08 AM  Paginations length 11
10/19/2023, 11:59:08 AM  Generating tag roots
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

ParseError: Unterminated string constant
    at error (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16669:19)
    at Parser$1.error (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16747:9)
    at Parser$1.acorn_error (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16741:14)
    at Object.read_script [as read] (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:8793:16)
    at tag (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:15695:33)
    at new Parser$1 (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16706:21)
    at parse$I (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16838:20)
    at compile (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:46610:17)
    at compileSvelte2 (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:466:22)
    at async Object.transform (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:2202:25) {
  name: 'RollupError',
  id: '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte',
  frame: ' 47 |  \n' +
    ' 48 |  \n' +
    ' 49 |     $diffs[\'2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser\'] = {"contents":"diff --git a/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md b/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md\\nindex 9135f0d..471dd0b 100644\\n--- a/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md\\n+++ b/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md\\n@@ -1,19 +1,115 @@\\n ---\\n-title: \\"building webapps for the Amazon Kindle Paperwhite browser\\"\\n+title: \\"Building webapps for the Amazon Kindle eInk web browser\\"\\n published: true\\n date: 2023-10-16\\n+attachments:\\n+  enterprise_wide_website:\\n+    filename: webiphanysvekyll/2023-10-17_9724322_0.png\\n+tags: kindle, javascript\\n+---\\n \\n-maps: {}\\n+If you remove kid controls, you can see a menu in the Kindle paperwhite reader that indicates web browser.  I wanted to see what capabilities it has.\\n \\n-attachments: {}\\n+First, what kind of browser is reported?\\n \\n+```\\n+$ pnpx http-server\\n+[
With this in my `_config.yml`: ``` ... revisions: enabled: true message: true full: true ... ``` I see this crash (`ParseError: Unterminated string constant`): (I believe this is probably that the diffs hash is not correctly converting/escaping the diff and when that is inserted into the pre-compiled template, the svelte compiler crashes.) The temporary fix is to disabled revisions for now. ``` $ node $(which yarn) build yarn run v1.22.10 warning package.json: No license field $ yarn svekyll-cli build && yarn svekyll-cli finalize warning package.json: No license field $ /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/.bin/svekyll-cli build NOTICE: No blog roll found, skipping Error: ENOENT: no such file or directory, open './blogs.json' Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Browserslist: caniuse-lite is outdated. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme NOTICE: Unable to find local index.html, loading from node modules NOTICE: Unable to find local src/Index.svelte, loading from node modules NOTICE: Unable to find local src/Page.svelte, loading from node modules NOTICE: Unable to find local src/index.html, loading from node modules NOTICE: Unable to find local svekyll/svekyll.css, loading from node modules 10/19/2023, 11:59:05 AM Found 410 candidates 10/19/2023, 11:59:05 AM Generated files 101 10/19/2023, 11:59:08 AM Paginations length 11 10/19/2023, 11:59:08 AM Generating tag roots node:internal/process/promises:288 triggerUncaughtException(err, true /* fromPromise */); ^ ParseError: Unterminated string constant at error (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16669:19) at Parser$1.error (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16747:9) at Parser$1.acorn_error (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16741:14) at Object.read_script [as read] (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:8793:16) at tag (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:15695:33) at new Parser$1 (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16706:21) at parse$I (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:16838:20) at compile (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/compiler.mjs:46610:17) at compileSvelte2 (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:466:22) at async Object.transform (file:///home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:2202:25) { name: 'RollupError', id: '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte', frame: ' 47 | \n' + ' 48 | \n' + ' 49 | $diffs[\'2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser\'] = {"contents":"diff --git a/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md b/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md\\nindex 9135f0d..471dd0b 100644\\n--- a/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md\\n+++ b/posts/2023-10-16-building-webapps-for-the-amazon-kindle-paperwhite-browser.md\\n@@ -1,19 +1,115 @@\\n ---\\n-title: \\"building webapps for the Amazon Kindle Paperwhite browser\\"\\n+title: \\"Building webapps for the Amazon Kindle eInk web browser\\"\\n published: true\\n date: 2023-10-16\\n+attachments:\\n+ enterprise_wide_website:\\n+ filename: webiphanysvekyll/2023-10-17_9724322_0.png\\n+tags: kindle, javascript\\n+---\\n \\n-maps: {}\\n+If you remove kid controls, you can see a menu in the Kindle paperwhite reader that indicates web browser. I wanted to see what capabilities it has.\\n \\n-attachments: {}\\n+First, what kind of browser is reported?\\n \\n+```\\n+$ pnpx http-server\\n+[ ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
svekyll/svekyll-cli#12
No description provided.