question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Error: No hook for resolver normal in object ResolverFactory" error on yarn/npm build

See original GitHub issue

Description

I am getting the error “Error: No hook for resolver normal in object ResolverFactory” intermittently when building a web project built with Esri JS API 4.13.2 and the ArcGIS Webpack plugin.4.13.0. The error does not occur consistently, but once I do start getting it, the only solution appears to be cloning a completely fresh copy of my project repo and building from that. I am confused as to why this error only seems to occur intermittently, and can’t offer any more details as to when or why it starts occurring.

This a full trace of the build error:

$ yarn run start
yarn run v1.16.0
$ webpack --mode=development --watch --progress
C:\Projects\abc\xyz\en_react\node_modules\webpack-cli\bin\cli.js:281
                                throw err;
                                ^

Error: No hook for resolver normal in object ResolverFactory
    at names.forEach.name (C:\Projects\abc\xyz\en_react\node_modules\webpack-plugin-compat\lib\pluginCompatV4.js:101:11)
    at Array.forEach (<anonymous>)
    at events.forEach.event (C:\Projects\abc\xyz\en_react\node_modules\webpack-plugin-compat\lib\pluginCompatV4.js:98:9)
    at Array.forEach (<anonymous>)
    at Object.tap (C:\Projects\abc\xyz\en_react\node_modules\webpack-plugin-compat\lib\pluginCompatV4.js:93:9)
    at DojoAMDResolverPluginV4.apply (C:\Projects\abc\xyz\en_react\node_modules\dojo-webpack-plugin\lib\DojoAMDResolverPluginV4.js:28:3)
    at applyResolverPlugin (C:\Projects\abc\xyz\en_react\node_modules\dojo-webpack-plugin\lib\compat.js:55:39)
    at DojoAMDPlugin.apply (C:\Projects\abc\xyz\en_react\node_modules\dojo-webpack-plugin\lib\DojoAMDPlugin.js:57:3)
    at plugins.forEach.plugin (C:\Projects\abc\xyz\en_react\node_modules\@arcgis\webpack-plugin\index.js:97:38)
    at Array.forEach (<anonymous>)
    at ArcGISPlugin.apply (C:\Projects\abc\xyz\en_react\node_modules\@arcgis\webpack-plugin\index.js:97:13)
    at webpack (C:\Projects\abc\xyz\en_react\node_modules\webpack\lib\webpack.js:51:13)
    at processOptions (C:\Projects\abc\xyz\en_react\node_modules\webpack-cli\bin\cli.js:272:16)
    at yargs.parse (C:\Projects\abc\xyz\en_react\node_modules\webpack-cli\bin\cli.js:364:3)
    at Object.parse (C:\Projects\abc\xyz\en_react\node_modules\yargs\yargs.js:567:18)
    at C:\Projects\abc\xyz\en_react\node_modules\webpack-cli\bin\cli.js:49:8
    at Object.<anonymous> (C:\Projects\abc\xyz\en_react\node_modules\webpack-cli\bin\cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Projects\abc\xyz\en_react\node_modules\webpack\bin\webpack.js:156:2)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

A similar issue was noted on Geonet, though there is no clear resolution that I can see on that thread: https://community.esri.com/thread/217740-error-no-hook-for-resolver-normal-in-object-resolverfactory

Expected Behavior

Project should build consistently

Actual Behavior

Project intermittently fails on yarn (or npm) build, with the error noted in the title/description.

Possible Fix

Curious whether an update to some other dependency may resolve this (webpack, webpack-cli?, perhaps an update to dojo-webpack-plugin that is a dependency for esri-webpack-plugin?).

Steps to Reproduce

I have not tried to reproduce this in a generic project, at least not yet. I can’t actually pinpoint when and why this error starts occurring. I typically get several successful builds, and then once the error occurs, I cannot seem to get around it without cloning a fresh copy of my repo

Context

Unable to consistently develop/test/build my JS Api project

Your Environment

Windows version 10.0.17134 Build 17134 Node v10.17.0 npm 6.11.3 yarn 1.16.0

Esri JS API: 4.13.2 ArcGIS webpack plugin: 4.13.0

Webpack-related dependencies in my project: $ yarn list --depth=0 --pattern webpack yarn list v1.16.0 ├─ @arcgis/webpack-plugin@4.13.0 ├─ copy-webpack-plugin@5.0.5 ├─ dojo-webpack-plugin@2.8.10 ├─ terser-webpack-plugin@1.4.1 ├─ webpack-bundle-analyzer@3.6.0 ├─ webpack-cli@3.3.10 ├─ webpack-hasjs-plugin@1.0.3 ├─ webpack-log@2.0.0 ├─ webpack-plugin-compat@1.0.3 ├─ webpack-sources@1.4.3 └─ webpack@4.41.2 Done in 0.48s.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
elake2018commented, Dec 21, 2020

I have been getting this as well for some time, everything seems to work so I just ignore it for now.

1reaction
besLisbethcommented, Dec 2, 2019

Did you try to remove node_modules and package-lock.json and run npm i? It sometimes happens after the update of the dependencies.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes | Yarn - Package Manager
A list of Yarn's error codes with detailed explanations. ... This code is used to log regular messages, mostly to align all the...
Read more >
enhanced-resolve - npm
The easiest way to create a resolver is to use the createResolver function on ResolveFactory , along with one of the supplied File...
Read more >
npm run build error for html-webpack-plugin - Stack Overflow
I am following their tutorial online to the T but for some reason when I run the command "npm run build" I get...
Read more >
node_modules/enhanced-resolve - PLMlab
The easiest way to create a resolver is to use the createResolver function on ResolveFactory , along with one of the supplied File...
Read more >
Husky - Git hooks
Modern native git hooks made easy. Husky improves your commits and more woof! You can use it to lint your commit messages, run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found