-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: resolver.ensureHook is not a function #2
Comments
I had this issue as well, and it was because I mistakenly placed the PnpWebpackPlugin within the regular Maybe double check your webpack.config.js? const PnpWebpackPlugin = require(`pnp-webpack-plugin`);
module.exports = {
resolve: {
plugins: [
PnpWebpackPlugin,
],
},
resolveLoader: {
plugins: [
PnpWebpackPlugin.moduleLoader(module),
],
},
plugins : [
// ** NOT in here **
// PnpWebpackPlugin.moduleLoader(module)
]
// ... etc
}; Note that it goes into both the |
Might be good to check for this kind of thing and print an helpful error message 😃 |
I'm getting this issue but have it configured in the right place. I'm working in a webpack 3 repo. Does this have any incompatibility issues between webpack 3 and 4? @arcanis |
Yes, webpack 3 (actually enhanced-resolve 3) uses a different API for plugins. It should be fairly easy to support both styles of APIs though, if you'd like to start a PR! |
I have something working and going to push a PR soon. @arcanis Do you think this is necessary for older enhanced-resolve versions and if so, is it covered by the tests? Lines 60 to 66 in b09fbdc
|
I'm not sure what's the behavior on older enhanced-resolve releases, but the intent is that symlinks shouldn't be resolved (otherwise it breaks peer dependencies). It seems it isn't tested at the moment - if you can add one it would be perfect (you can just create a dummy symlink in the |
when i using awesome-typescript-loader.TsConfigPathsPlugin, this function was used. in webpack4. i got the same error |
Hi, @arcanis
I followed your instructions and made some progress but i am still facing issues.
You can check my webpack.config.dev.js
Environment
Steps
You will see this error
Click to see error log
I am using the latest version of the packages.
Let me know what i am missing here.
The text was updated successfully, but these errors were encountered: