Cannot resolve module 'raw-script' in node_modules\@microsoft\sp-module-loader\lib

Iron Contributor


Started working on an old spfx webaprt priject that was working a fewe weeks ago. Somehow today the PropertyPaneDropdown wasn't displaying the options provided to it. I figured i needed to update to drop 6 to get thigs working. After doing so Inow get this error in the build:

[12:58:13] Starting subtask 'configure-webpack'...

[12:58:13] Finished subtask 'configure-webpack' after 60 ms

[12:58:13] Starting subtask 'webpack'...

[12:58:21] Error - [webpack] 'dist':
Module not found: Error: Cannot resolve module 'raw-script' in C:\Users\xxxxx\Documents\GitHub\spfxsecuritywebpart\node_modules\@microsoft\sp-module-loader\lib
resolve module raw-script in C:\Users\xxxxx\Documents\GitHub\spfxsecuritywebpart\node_modules\@microsoft\sp-module-loader\lib
  looking for modules in C:\Users\xxxxxx\Documents\GitHub\spfxsecuritywebpart\node_modules\@microsoft\sp-build-core-tasks\node_modules
  module variation @microsoft/loader-raw-script



I searched my entire directory for a file called 'raw-script'  but cannot find it. Any ideaas what might be causing this?

2 Replies
best response confirmed by Russell Gove (Iron Contributor)

run npm i @microsoft/sp-module-loader

And add in  the config.json refernce to the @microsoft/sp-module-loader under  the externals section (first line).