You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On using plugins with the posthtml-loader using a posthtml.config.js or stating the configuration directly in the webpack.config.js, I constantly get a TypeError: require(...) is not a function.
- ModuleBuildError: Module build failed (from ../node_modules/posthtml-loader/lib/index.js):
- PostHTML Loader:
- require(...) is not a function
❌ Error (Logs|Stacks)
Using posthtml.config.js:
TypeError: require(...) is not a function
at load (/home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:40:31)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:51:18
at Array.forEach ()
at plugins (/home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:50:8)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/index.js:66:18
TypeError: Cannot read properties of undefined (reading 'default')
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:53:20
at Array.forEach ()
at plugins (/home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:50:8)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/index.js:66:18
TypeError: require(...) is not a function
at load (/home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:40:31)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:51:18
at Array.forEach ()
at plugins (/home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:50:8)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/index.js:66:18
TypeError: Cannot read properties of undefined (reading 'default')
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:53:20
at Array.forEach ()
at plugins (/home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/lib/plugins.js:50:8)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-load-config/index.js:66:18
Using webpack.config.js
ERROR in ./index.html
Module build failed (from ./node_modules/posthtml-loader/lib/index.js):
PostHTML Loader:
require(...) is not a function
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-loader/lib/index.js:158:10
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-loader/lib/index.js:158:10
at processResult (/home/apollo/posthtml-loader-require-bug/node_modules/webpack/lib/NormalModule.js:753:19)
at /home/apollo/posthtml-loader-require-bug/node_modules/webpack/lib/NormalModule.js:855:5
at /home/apollo/posthtml-loader-require-bug/node_modules/loader-runner/lib/LoaderRunner.js:399:11
at /home/apollo/posthtml-loader-require-bug/node_modules/loader-runner/lib/LoaderRunner.js:251:18
at context.callback (/home/apollo/posthtml-loader-require-bug/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
at /home/apollo/posthtml-loader-require-bug/node_modules/posthtml-loader/lib/index.js:158:7
On using plugins with the posthtml-loader using a
posthtml.config.js
or stating the configuration directly in thewebpack.config.js
, I constantly get aTypeError: require(...) is not a function.
❌ Error (Logs|Stacks)
Using posthtml.config.js:
Using webpack.config.js
♻️ Reproduction (Code)
🌐 Environment
html-loader: "^3.1.0"
posthtml: "^0.15.2"
webpack: "^5.69.0"
webpack-cli: "^4.9.2"
The text was updated successfully, but these errors were encountered: