Closed zvictor closed 1 year ago
Hello @zvictor. Can you send me a message at our community slack with your project id?
This issue is caused by this line: https://github.com/plasmicapp/plasmic/blob/95aaf8f7ce29378844e1078fd99089ab30694ea4/packages/cli/src/utils/npm-utils.ts#L172
The problem with this glob is that node_modules can contain all sorts of things inside it.
E.g. In my case, as I am the author of Brainyduck, I do not install it from the registry but from my local disk. As result, the **/node_modules
glob will traverse all the node_modules folders inside all the other folders. That can also lead to circular references, such as ${rootDir}/node_modules/@brainy/domain/node_modules/brainyduck/examples/modularized-esbuild-bundle/node_modules/brainyduck/examples/modularized-esbuild-bundle/node_modules/brainyduck/examples/modularized/node_modules/brainyduck/node_modules/log-symbols/package.json
(the circular dependency comes from here)
But even if circular dependencies are not a problem, this glob will suffer drastically from performance the heavier the node_modules folder is.
Please try running the script below in your projects and notice the speed of it.
Then run the script again but with the line const pkg = '*'
uncommented. Notice how many unnecessary searching it does in your directories?
const fg = require('fast-glob');
const rootDir = process.cwd();
const pkg = `@plasmicapp/react-web`
// const pkg = '*'
fg.stream(`${rootDir}/**/node_modules/${pkg}/package.json`, {
// ignore:`**/node_modules/**/node_modules/**`
})
.on('data', (file) => {
console.log(file);
})
.on('end', () => {
console.log('done');
})
.on('error', (err) => {
throw err
})
.on('close', () => {
console.log('closed');
})
Thank you for the patch! We will handle it once some folks are back in the office. :-)
I have been trying to setup a new Plasmic project, but
plasmic sync
insists on failing. The command works as expected up to the creation of theplasmic.json
file, but after that it hangs forever.It hangs there for a couple of minutes without any new message or any code synced. If I wait long enough, an OOM error shows up:
Things I have tried:
plasmic.json
files--all-files