patternfly-elements
patternfly-elements copied to clipboard
table-of-contents plugin import issue with node v15.10
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
- Go to this MWE and clone it
- Change into that directory and run
npm iin a terminal - Run
npm run watchin a terminal - Check console
- See error
Expected behavior
Being able to import the plugin w/o issues