Certain files cause revisions history to crash svekyll-cli #9

Open
opened 2023-10-10 20:36:21 +00:00 by xrdawson · 1 comment
xrdawson commented 2023-10-10 20:36:21 +00:00 (Migrated from extrastatic.dev)

Summary

Not sure why, but certain revisions (git history) causes the svelte/vite plugin to crash. Disabling revisions globally, or on a per file basis seems to fix things.

Fixes

Add to the new post YFM if you can identify which change caused it:

revisions_disabled: true

Or, disable revisions display globally by commenting out revisions, or removing that configuration entirely:

# revisions:
#  enabled: true
#  message: true
#  full: true

It could be that this is happening because this was on a branch. Revisions history is calculated differently when the post is on a branch. I'll consider adding code to detect this (when running inside the CI) so that if it detects a !{main|master} then to skip revisions generation. The issue with this is that the preview site will not look 100% identical to the final site when the post is merged to main.

Stack Trace

Partial stack trace:

$ /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'
  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/10/2023, 11:06:55 AM  Found 410 candidates
10/10/2023, 11:06:55 AM  Generated files 101
10/10/2023, 11:06:57 AM  Paginations length 11
10/10/2023, 11:06:57 AM  Generating tag roots
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

ParseError: Unterminated string constant
    at error (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13207:19)
    at Parser$1.error (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13285:9)
    at Parser$1.acorn_error (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13279:14)
    at Object.read_script [as read] (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:9004:16)
    at tag (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:12231:33)
    at new Parser$1 (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13244:21)
    at parse$b (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13384:20)
    at compile (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:44078:17)
    at compileSvelte (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@2.4.5_svelte@3.59.2+vite@4.4.9/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js:126:20)
    at async Object.transform (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@2.4.5_svelte@3.59.2+vite@4.4.9/node_modules/@sveltejs/vite-plugin-svelte/src/index.js:220:20) {
  name: 'RollupError',
  id: '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte',
  frame: ' 47 |  \n' +
    ' 48 |  \n' +
...
  code: 'PLUGIN_ERROR',
  loc: {
    line: 49,
    column: 57,
    file: '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte'
  },
  pluginCode: 'parse-error',
  plugin: 'vite-plugin-svelte',
  hook: 'transform',
  watchFiles: [
    '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/index.html',
    '\x00vite/modulepreload-polyfill',
    '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/main.js',
    '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/package.json',
    '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte',
    '/home/chrisdawson/Projects/ExtraStatic/svekyll-cli/svekyll/debug.js',
    '/home/chrisdawson/Projects/ExtraStatic/svekyll-cli/package.json',
    '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/store/index.mjs',
    '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/internal/index.mjs'
  ]
}

Node.js v18.16.1
## Summary Not sure why, but certain revisions (git history) causes the svelte/vite plugin to crash. Disabling revisions globally, or on a per file basis seems to fix things. ## Fixes Add to the new post YFM if you can identify which change caused it: ``` revisions_disabled: true ``` Or, disable revisions display globally by commenting out revisions, or removing that configuration entirely: ``` # revisions: # enabled: true # message: true # full: true ```` It could be that this is happening because this was on a branch. Revisions history is calculated differently when the post is on a branch. I'll consider adding code to detect this (when running inside the CI) so that if it detects a `!{main|master}` then to skip revisions generation. The issue with this is that the preview site will not look 100% identical to the final site when the post is merged to main. ## Stack Trace Partial stack trace: ``` $ /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' 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/10/2023, 11:06:55 AM Found 410 candidates 10/10/2023, 11:06:55 AM Generated files 101 10/10/2023, 11:06:57 AM Paginations length 11 10/10/2023, 11:06:57 AM Generating tag roots node:internal/process/promises:288 triggerUncaughtException(err, true /* fromPromise */); ^ ParseError: Unterminated string constant at error (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13207:19) at Parser$1.error (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13285:9) at Parser$1.acorn_error (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13279:14) at Object.read_script [as read] (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:9004:16) at tag (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:12231:33) at new Parser$1 (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13244:21) at parse$b (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:13384:20) at compile (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/svelte@3.59.2/node_modules/svelte/compiler.mjs:44078:17) at compileSvelte (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@2.4.5_svelte@3.59.2+vite@4.4.9/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js:126:20) at async Object.transform (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@2.4.5_svelte@3.59.2+vite@4.4.9/node_modules/@sveltejs/vite-plugin-svelte/src/index.js:220:20) { name: 'RollupError', id: '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte', frame: ' 47 | \n' + ' 48 | \n' + ... code: 'PLUGIN_ERROR', loc: { line: 49, column: 57, file: '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte' }, pluginCode: 'parse-error', plugin: 'vite-plugin-svelte', hook: 'transform', watchFiles: [ '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/index.html', '\x00vite/modulepreload-polyfill', '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/main.js', '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/package.json', '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/root/page/0/src/Index.svelte', '/home/chrisdawson/Projects/ExtraStatic/svekyll-cli/svekyll/debug.js', '/home/chrisdawson/Projects/ExtraStatic/svekyll-cli/package.json', '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/store/index.mjs', '/home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/svelte/internal/index.mjs' ] } Node.js v18.16.1 ```
xrdawson commented 2023-10-10 20:36:48 +00:00 (Migrated from extrastatic.dev)

changed the description

changed the description
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#9
No description provided.