There is error in SPFx manifest file at runtime

51 Views Asked by At

I had old spfx project which was recently developed using node v14.18.0. Now there is a need to upgrade the project to Node v18.18.2. So whatever dependencies needs to be upgraded I have upgraded all those in package.json file and installed node modules. Build and bundle both got succeeded but I have to debug this code for my new requirement. So I did gulp serve and tried to load script on chrome browser using "?debug=true&nodir=true&debugmanifestfile=".

This gave me error "Error loading manifest file. Type Error: Cannot convert undefined or null to object".

After that when I debug the manifest file I found that this error is where the paths:{} are empty e.g Below is the code in manifest where this error is:

"testStrings":{

 "defaultPath": "lib/webarts/test/loc/en-us.js",



  "type": "localizedPath",



  "Paths": {}

}

If let's say I remove this paths from here then it will work but manifest generates automatically after serve/bundle. So it recurring issue. Also, I have another solution where the same code is in manifest but that loads in browser without any issue.

Anyone knows the solution?

Thanks in advance.

I tried below things:

  1. Upgraded all modules dependencies with 1.14 version to 1.18.2 and installed node modules

  2. Created new project and copied src folder

  3. Using M365 upgrade report, fixed all things mentioned in the report.

Nothing worked. Now expecting to have this worked as facing this type error at run time

0

There are 0 best solutions below