Error: No hook for resolver normal in object ResolverFactory

1969
9
07-12-2018 10:30 AM
deleted-user-Y1VvmtgNOW9P
New Contributor

Hello.

I am encountering this reoccurring error message when attempting to run and compile the template map via the "ArcGIS JS API CLI (Introducing a cli for the ArcGIS API for JavaScript )" and "Maps App for Javascript" (Maps App for JavaScript | ArcGIS for Developers ).

Each time I install, the apps appear to be in good working order. However each time I attempt I run and compile via "npm start", I encounter the same error message. I have tried multiple fresh installs, manually re-installing nodes where errors are occurring, and following all recommended steps via the github page, including the recommended install of "Windows-Build-Tools".

Has anyone else encountered this issue? I am fairly new to development and npm/cli, so any help would be greatly appreciated. I apologize in advance if this question is not formatted correctly!

The full error message (which is consistent and repeatable) is as follows:

PS C:\Users\pjulian\documents\projects\ESRI_Test\NewProject> npm start

> NewProject@0.0.1 start C:\Users\pjulian\documents\projects\ESRI_Test\NewProject
> webpack-dev-server --mode development --open

clean-webpack-plugin: C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\dist has been removed.
C:\Users\pjulian\Documents\Projects\ESRI_Test\NewProject\node_modules\webpack-dev-server\bin\webpack-dev-server.js:385
throw e;
^

Error: No hook for resolver normal in object ResolverFactory
at names.forEach.name (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\dojo-webpack-plugin\lib\pluginCompatV4.js:95:13)
at Array.forEach (<anonymous>)
at events.forEach.event (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\dojo-webpack-plugin\lib\pluginCompatV4.js:92:9)
at Array.forEach (<anonymous>)
at Object.tap (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\dojo-webpack-plugin\lib\pluginCompatV4.js:87:9)
at DojoAMDResolverPluginV4.apply (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\dojo-webpack-plugin\lib\DojoAMDResolverPluginV4.js:28:3)
at applyResolverPlugin (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\dojo-webpack-plugin\lib\compat.js:70:39)
at DojoAMDPlugin.apply (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\dojo-webpack-plugin\lib\DojoAMDPlugin.js:48:3)
at requiredPlugins.forEach.plugin (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\@arcgis\webpack-plugin\index.js:93:46)
at Array.forEach (<anonymous>)
at ArcGISPlugin.apply (C:\Users\pjulian\documents\projects\ESRI_Test\NewProject\node_modules\@arcgis\webpack-plugin\index.js:93:21)
at webpack (C:\Users\pjulian\Documents\Projects\ESRI_Test\NewProject\node_modules\webpack\lib\webpack.js:37:12)
at startDevServer (C:\Users\pjulian\Documents\Projects\ESRI_Test\NewProject\node_modules\webpack-dev-server\bin\webpack-dev-server.js:379:16)
at portfinder.getPort (C:\Users\pjulian\Documents\Projects\ESRI_Test\NewProject\node_modules\webpack-dev-server\bin\webpack-dev-server.js:369:5)
at C:\Users\pjulian\Documents\Projects\ESRI_Test\NewProject\node_modules\portfinder\lib\portfinder.js:160:14
at C:\Users\pjulian\Documents\Projects\ESRI_Test\NewProject\node_modules\async\lib\async.js:52:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! NewProject@0.0.1 start: `webpack-dev-server --mode development --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the NewProject@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Any help in identifying the error is greatly appreciated! 

0 Kudos
9 Replies
ReneRubalcava
Frequent Contributor

That's really odd. Even more so that it happens with both the CLI template app and the Maps-App-JS.

Could you provide some more details?

Windows version:

Node version:

NPM version:

That might help me narrow it down, thanks!

deleted-user-Y1VvmtgNOW9P
New Contributor

Thank you so much for taking a look at this. It is greatly appreciated!

Windows 10 - v1803 (OS Build 17134.48)

Node: v8.11.3

NPM: 6.1.0

Thanks!

0 Kudos
NathanHolman3
New Contributor

Did this ever get solved? I'm trying to play with the CLI, but I'm getting this exact error.

deleted-user-Y1VvmtgNOW9P
New Contributor

Howdy!

Thanks for responding. Sorry to hear that you are encountering the same issue but it's somewhat reassuring to know that I am not the only one experiencing this.

As of now, I have yet to find a solution but hoping that someone in the community may have an answer.

0 Kudos
BedaKuster1
New Contributor

Hi,

We also run into this issue finding out the problem is related to wepback 4.19. Try to downgrade your webpack version to 4.8.0. To do that just run the following:

npm uninstall webpack

npm install --save-dev --save-exact webpack@4.8.0

this will keep webpack at version 4.8.0, even if you run npm update.

I don't know which versions of webpack also run into this issue, but 4.19 didn't work and 4.8 did.

Regards, Beda

ReneRubalcava
Frequent Contributor

I think this will be fixed in the next plugin release as it looks like it was fixed in an upstream dependency.

Build fails with Webpack 4.19.1 by chuckdumont · Pull Request #181 · OpenNTF/dojo-webpack-plugin · G... 

ReneRubalcava
Frequent Contributor

To be clear, I don't know if this will fix the original issue. I won't have time to test builds until middle of this week. It may or may not, as this issue didn't seem to impact all users.

0 Kudos
JohnPaschal
New Contributor

Hello Rene Rubalcava

Was the cause/fix for this issue ever discovered? I am having the same exact issue when I try to run either example projects under the arcgis-webpack-plugin github page.

The two example repos can be found here: 4.x/webpack/demo    odoe/jsapi-webpack

I am using:

Windows 10 Enterprise - Version 1809 - Build 17763.379

Node - 10.15.3

Npm - 6.4.1

I download the repo, install the deps, but then 'npm start' fails and I get the same exact error that the OP does. 

I have tried the latest version of webpack, 4.8 (as mentioned above), and many other 4.x versions of webpack with no avail. Any help would be much appreciated. Thank you.

0 Kudos
StevenGreenwaters
New Contributor

I finally solved this issue. I was getting exactly this same, "No hook for resolver normal in object ResolverFactory" error on two completely different computers every time I would run "npm start". Over six months, I tried many more times hoping a newer version of Esri's CLI would resolve this issue. I also tried the solution above about downgrading Webpack, and a solution on the Dojo Webpack Plugin repo about deleting node_modules/* and package-lock.json and re-running "npm install", but still kept getting the same error.

Eventually after spending a significant amount of time on this, I discovered the original problem occurred during the "arcgis create project" process. Even though it clearly shows in bright green and bold text "Done! Your ArcGIS JSAPI application has been installed!", if you look closely above that in light gray text it also says, "Oops, something went wrong." I didn't pay much attention to that the first 20 times because it's completely normal to see warnings and errors when installing a Node project. But this one turns out to be a critical failure from which there is no return.

The solution turned out to be amazingly simple. Although installing the Windows Build Tools required running PowerShell as an administrator, I had to then switch to either a regular Command Prompt or Node.js Command Prompt (as a non-administrator) to execute "npm install -g @arcgis/cli" and "arcgis create arcgiscli". Now the Esri CLI installs and "npm start" works perfectly every time.  I hope by sharing this solution I can spare someone else months of delay and countless hours of wasted time.