SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-34688%22%20slang%3D%22en-US%22%3ECannot%20resolve%20module%20'raw-script'%20in%20node_modules%5C%40microsoft%5Csp-module-loader%5Clib%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-34688%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EStarted%20working%20on%20an%20old%20spfx%20webaprt%20priject%20that%20was%20working%20a%20fewe%20weeks%20ago.%20Somehow%20today%20the%20PropertyPaneDropdown%20wasn't%20displaying%20the%20options%20provided%20to%20it.%20I%20figured%20i%20needed%20to%20update%20to%20drop%206%20to%20get%20thigs%20working.%20After%20doing%20so%20Inow%20get%20this%20error%20in%20the%20build%3A%3C%2FP%3E%3CP%3E%5B12%3A58%3A13%5D%20Starting%20subtask%20'configure-webpack'...%3C%2FP%3E%3CP%3E%5B12%3A58%3A13%5D%20Finished%20subtask%20'configure-webpack'%20after%2060%20ms%3C%2FP%3E%3CP%3E%5B12%3A58%3A13%5D%20Starting%20subtask%20'webpack'...%3C%2FP%3E%3CP%3E%5B12%3A58%3A21%5D%20Error%20-%20%5Bwebpack%5D%20'dist'%3A%3CBR%20%2F%3E.%2F~%2F%40microsoft%2Fsp-module-loader%2Flib%2FSystemJsWrapper.js%3CBR%20%2F%3EModule%20not%20found%3A%20Error%3A%20Cannot%20resolve%20module%20'raw-script'%20in%20C%3A%5CUsers%5Cxxxxx%5CDocuments%5CGitHub%5Cspfxsecuritywebpart%5Cnode_modules%5C%40microsoft%5Csp-module-loader%5Clib%3CBR%20%2F%3Eresolve%20module%20raw-script%20in%20C%3A%5CUsers%5Cxxxxx%5CDocuments%5CGitHub%5Cspfxsecuritywebpart%5Cnode_modules%5C%40microsoft%5Csp-module-loader%5Clib%3CBR%20%2F%3E%26nbsp%3B%20looking%20for%20modules%20in%20C%3A%5CUsers%5Cxxxxxx%5CDocuments%5CGitHub%5Cspfxsecuritywebpart%5Cnode_modules%5C%40microsoft%5Csp-build-core-tasks%5Cnode_modules%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3Bmodule%20variation%20%3Ca%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41501%22%3E%40microsoft%3C%2Fa%3E%2Floader-raw-script%3CBR%20%2F%3Eetc....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20searched%20my%20entire%20directory%20for%20a%20file%20called%20'raw-script'%26nbsp%3B%20but%20cannot%20find%20it.%20Any%20ideaas%20what%20might%20be%20causing%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-36781%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20resolve%20module%20'raw-script'%20in%20node_modules%5C%40microsoft%5Csp-module-loader%5Clib%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-36781%22%20slang%3D%22en-US%22%3E%3CP%3Ethanks%2C%20worked%20great!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-34967%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20resolve%20module%20'raw-script'%20in%20node_modules%5C%40microsoft%5Csp-module-loader%5Clib%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-34967%22%20slang%3D%22en-US%22%3E%3CP%3Erun%20npm%20i%20%3Ca%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41501%22%3E%40microsoft%3C%2Fa%3E%2Fsp-module-loader%3C%2FP%3E%0A%3CP%3EAnd%20add%20in%26nbsp%3B%20the%20config.json%20refernce%26nbsp%3Bto%20the%20%3Ca%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41501%22%3E%40microsoft%3C%2Fa%3E%2Fsp-module-loader%20under%20%26nbsp%3Bthe%20externals%20section%20(first%20line).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMeron%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Hi,

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':
./~/@microsoft/sp-module-loader/lib/SystemJsWrapper.js
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
etc....

 

 

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

2 Replies
Highlighted
Best Response confirmed by Russell Gove (Frequent Contributor)
Solution

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).

 

Meron

Highlighted