patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

table-of-contents plugin import issue with node v15.10

Open TonySpegel opened this issue 3 years ago • 0 comments

Description of the issue

When trying to import const pluginToc = require('@patternfly/pfe-tools/11ty/plugins/table-of-contents.cjs'); into the .eleventy.js config file with node v15.10 one would get a similar issue to the one below

[email protected] watch
npx @11ty/eleventy --watch

[11ty] Eleventy CLI Fatal Error: (more in DEBUG output)
[11ty] 1. Error in your Eleventy config file '/Users/tony/Dev/misc/11ty-base-blog-toc/.eleventy.js'. You may need to run `npm install`. (via EleventyConfigError)
[11ty] 2. Cannot find module '/Users/tony/Dev/misc/11ty-base-blog-toc/node_modules/@patternfly/pfe-tools/11ty/plugins/table-of-contents.cjs.js' (via Error)
[11ty] 
[11ty] Original error stack trace: Error: Cannot find module '/Users/tony/Dev/misc/11ty-base-blog-toc/node_modules/@patternfly/pfe-tools/11ty/plugins/table-of-contents.cjs.js'

Impacted component(s)

  • @patternfly/pfe-tools/11ty/plugins/table-of-contents.cjs

Steps to reproduce

  1. Go to this MWE and clone it
  2. Change into that directory and run npm i in a terminal
  3. Run npm run watch in a terminal
  4. Check console
  5. See error

Expected behavior

Being able to import the plugin w/o issues

TonySpegel avatar May 12 '22 14:05 TonySpegel