wrobins / cordova-plugin-msal

Use the newest Microsoft MSAL library in your Cordova-based project!
Apache License 2.0
23 stars 63 forks source link

Ensure browser platform is initialised before modifying json config #91

Closed peitschie closed 2 years ago

peitschie commented 2 years ago

Another minor tweak... this avoids the following error when building without having the browser platform prepared:

Prepared android project successfully
Executing script found in plugin cordova-plugin-msal for hook "after_prepare": plugins\cordova-plugin-msal\src\scripts\after_prepare.js
ENOENT: no such file or directory, open 'platforms/browser/browser.json'
Error: ENOENT: no such file or directory, open 'platforms/browser/browser.json'
    at Object.openSync (fs.js:476:3)
    at Object.readFileSync (fs.js:377:35)
    at Object.<anonymous> (J:\work\mobile-aurelia-baseline\plugins\cordova-plugin-msal\src\scripts\after_prepare.js:3:30)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at runScriptViaModuleLoader (J:\work\mobile-aurelia-baseline\node_modules\cordova-lib\src\hooks\HooksRunner.js:147:20)
    at runScript (J:\work\mobile-aurelia-baseline\node_modules\cordova-lib\src\hooks\HooksRunner.js:136:12)
    at J:\work\mobile-aurelia-baseline\node_modules\cordova-lib\src\hooks\HooksRunner.js:108:40
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
peitschie commented 2 years ago

Right... this might be the same issue as #88 ? Not sure which fix is better....

peitschie commented 2 years ago

89 has a more complete version of this fix. Closing this in preference of that 😅