Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid loading an app that its env was not loaded yet (#9194)
This PR fixes an issue of app data not being saved after running "create component" and then "snap" from the extension. The reason it happened is complex. It involves node.js caching package.json info and an API call of "getCompsMetadata" that was executed during the "create component" call. Because "getCompsMetadata" gets app-data, it tries to load the apps as plugins, which makes node access its package.json. At this stage, the package.json didn't have the "type: module" yet, so node.js assumes this is a CJS file. Later, bit re-write the package.json with the data from the env, which includes "type: module", but it's too late. Node.js already cached the package.json and refuses to see the change. This fix block the access to the app files unless the env is fully loaded, which then we assume the package.json is correct.
- Loading branch information