patrickxchong / eleventy-plugin-svg-sprite

A high performance Eleventy universal plugin that compiles a directory of SVG files into a single SVG Sprite and adds shortcodes to embed SVG Sprite and SVG content in Eleventy templates.
MIT License
41 stars 6 forks source link

Original error stack trace: TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function. #15

Closed bronze closed 1 year ago

bronze commented 1 year ago

Hi. Any idea what may be going on?

[11ty] Problem writing Eleventy templates:
[11ty] The "original" argument must be of type function. Received an instance of Object (via TypeError)
  Eleventy:EleventyErrorHandler (error stack): TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function. Received an instance of Object
  Eleventy:EleventyErrorHandler     at Object.promisify (node:internal/util:343:3)
  Eleventy:EleventyErrorHandler     at SVGSprite.compile (/home/bronze/coding/bsand/node_modules/.pnpm/eleventy-plugin-svg-sprite@2.4.0_@11ty+eleventy@2.0.1/node_modules/eleventy-plugin-svg-sprite/src/SVGSprite.js:24:27)
  Eleventy:EleventyErrorHandler     at AsyncEventEmitter.<anonymous> (/home/bronze/coding/bsand/node_modules/.pnpm/eleventy-plugin-svg-sprite@2.4.0_@11ty+eleventy@2.0.1/node_modules/eleventy-plugin-svg-sprite/.eleventy.js:26:76)
  Eleventy:EleventyErrorHandler     at /home/bronze/coding/bsand/node_modules/.pnpm/@11ty+eleventy@2.0.1/node_modules/@11ty/eleventy/src/Util/AsyncEventEmitter.js:19:61
  Eleventy:EleventyErrorHandler     at Array.map (<anonymous>)
  Eleventy:EleventyErrorHandler     at AsyncEventEmitter.emit (/home/bronze/coding/bsand/node_modules/.pnpm/@11ty+eleventy@2.0.1/node_modules/@11ty/eleventy/src/Util/AsyncEventEmitter.js:19:34)
  Eleventy:EleventyErrorHandler     at Eleventy.executeBuild (/home/bronze/coding/bsand/node_modules/.pnpm/@11ty+eleventy@2.0.1/node_modules/@11ty/eleventy/src/Eleventy.js:1175:32)
  Eleventy:EleventyErrorHandler     at Eleventy.write (/home/bronze/coding/bsand/node_modules/.pnpm/@11ty+eleventy@2.0.1/node_modules/@11ty/eleventy/src/Eleventy.js:1109:17)
  Eleventy:EleventyErrorHandler     at Eleventy.watch (/home/bronze/coding/bsand/node_modules/.pnpm/@11ty+eleventy@2.0.1/node_modules/@11ty/eleventy/src/Eleventy.js:1014:29)
  Eleventy:EleventyErrorHandler     at /home/bronze/coding/bsand/node_modules/.pnpm/@11ty+eleventy@2.0.1/node_modules/@11ty/eleventy/cmd.js:91:16 +0ms
  Eleventy:Benchmark Benchmark      7ms   1%     9× (Aggregate) Configuration addPlugin +0ms
[11ty] Wrote 0 files in 0.01 seconds (v2.0.1)

Using node 18.15.0

> node -v
v18.15.0

Cheers!

bronze commented 1 year ago

nvm probably relates to https://github.com/patrickxchong/eleventy-plugin-svg-sprite/issues/11

patrickxchong commented 1 year ago

@bronze I finally had the time to look into this a bit more. Have explicitly installed Glob v10 and updated the code to use the glob function that supports promises. Published v2.4.2 with the fix. Apologies for all inconveniences caused. :pray: