oleeskild / digitalgarden

275 stars 159 forks source link

upgrading to v1.52.0 results in error: about eleventy-plugin-gen-favicons #161

Closed hdchieh closed 1 year ago

hdchieh commented 1 year ago

I have added a custom css file: src\site\styles\user\changeIcon.css

body {
    --note-icon-1: url(/img/custom.svg);
    --note-icon-2: url(/favicon.svg);
    --note-icon-3: url(/img/tree-3.svg);
    --note-icon-fallback: url(/img/default-note-icon.svg);
}

no more custom change.

and here is the error output from netlify.


6:06:49 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output) 6:06:49 PM: [11ty] 1. Having trouble writing to "dist/contents/diffusion-model-mathematics/index.html" from "./src/site/notes/Default/Diffusion model - mathematics.md" (via EleventyTemplateError) 6:06:49 PM: [11ty] 2. (./src/site/_includes/layouts/note.njk) 6:06:49 PM: [11ty] Template render error: (/opt/build/repo/src/site/_includes/components/pageheader.njk) 6:06:49 PM: [11ty] EleventyShortcodeError: Error with Nunjucks shortcode favicons (via Template render error) 6:06:49 PM: [11ty] 3. Expected number between 1 and 100000 for density but received 0.5625 of type number (via Template render error) 6:06:49 PM: [11ty] 6:06:49 PM: [11ty] Original error stack trace: Error: Expected number between 1 and 100000 for density but received 0.5625 of type number 6:06:49 PM: [11ty] at Object.invalidParameterError (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/node_modules/sharp/lib/is.js:124:10) 6:06:49 PM: [11ty] at Sharp._createInputDescriptor (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/node_modules/sharp/lib/input.js:92:18) 6:06:49 PM: [11ty] at new Sharp (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/node_modules/sharp/lib/constructor.js:341:29) 6:06:49 PM: [11ty] at Sharp (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/node_modules/sharp/lib/constructor.js:169:12) 6:06:49 PM: [11ty] at resizedSharp (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/favicon-gen.js:34:10) 6:06:49 PM: [11ty] at /opt/build/repo/node_modules/eleventy-plugin-gen-favicons/favicon-gen.js:41:33 6:06:49 PM: [11ty] at Array.map () 6:06:49 PM: [11ty] at icoBuf (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/favicon-gen.js:41:20) 6:06:49 PM: [11ty] at module.exports (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/favicon-gen.js:92:7) 6:06:49 PM: [11ty] at async Object. (/opt/build/repo/node_modules/eleventy-plugin-gen-favicons/index.js:25:28) 6:06:50 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2) 6:06:49 PM: [11ty] Copied 29 files / Wrote 0 files in 0.42 seconds (v2.0.1) 6:06:49 PM: ERROR: "build:eleventy" exited with 1. 6:06:49 PM: ​ 6:06:49 PM: "build.command" failed
6:06:49 PM: ──────────────────────────────────────────────────────────────── 6:06:49 PM: ​ 6:06:49 PM: Error message 6:06:49 PM: Command failed with exit code 1: npm install && npm run build (https://ntl.fyi/exit-code-1) 6:06:49 PM: ​ 6:06:49 PM: Error location 6:06:49 PM: In build.command from netlify.toml: 6:06:49 PM: npm install && npm run build 6:06:49 PM: ​ 6:06:49 PM: Resolved config 6:06:49 PM: build: 6:06:49 PM: command: npm install && npm run build 6:06:49 PM: commandOrigin: config 6:06:49 PM: publish: /opt/build/repo/dist 6:06:49 PM: publishOrigin: config 6:06:49 PM: functionsDirectory: /opt/build/repo/netlify/functions 6:06:49 PM: redirects: 6:06:50 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 6:06:50 PM: Failing build: Failed to build site 6:06:51 PM: Finished processing build request in 18.172s

oleeskild commented 1 year ago

I think this might have been fixed now. Can you try to update the template again and see if it works now @hdchieh?

hdchieh commented 1 year ago

I think this might have been fixed now. Can you try to update the template again and see if it works now @hdchieh?

It is still the error.

keerah commented 1 year ago

having the same problem with updating to 1.53 from 1.49.2 starts with: [eleventy] [11ty] Problem writing Eleventy templates: (more in DEBUG output)

anantshri commented 1 year ago

I checked your issue https://github.com/NJAldwin/eleventy-plugin-gen-favicons/issues/7 and this error is occuring in that specific svg file at my end also but not on other files.

quick fix would be to try another svg. long term fix would be favicons plugin figuring out what is wrong with svg.

hdchieh commented 1 year ago

I checked your issue NJAldwin/eleventy-plugin-gen-favicons#7 and this error is occuring in that specific svg file at my end also but not on other files.

quick fix would be to try another svg. long term fix would be favicons plugin figuring out what is wrong with svg.

Thanks. You're right. There seems to be no better way.

russellgordon commented 1 year ago

FWIW, some experimentation suggests this is due to the SVG file in question not being 1:1 in terms of aspect ratio – that is to say: square.

I had the same problem described above. Opening the SVG file in an appropriate editor (I used Inkscape), making a new document with a 1:1 aspect ratio, copying the old SVG image into the new document, and then saving a new SVG... and using that with Digital Garden... things seemed to work just fine after that.