createPlasmicElementProxy is not being imported or being removed by prettier on sync

My pages break on sync because createPlasmicElementProxy is missing from imports. I can’t seem to debug why this is happening. I first thought i was because of my prettier or eslint config but I added the generated folder to the ignore files and I still get the same issue.

I tried removing my eslint config and prettier config as well… no luck.

Something I found is that when I install my dependencies using Yarn, I get the prettier package in the node_modules of @plasmicapp/cli and everything runs fine, I get the createPlasmicElementProxy` and everything is smooth. But when I install using NPM, I don’t… Prettier is only installed in the root of the node_modules of my project because Prettier is also a dependency of my project.

Has anyone come across this or have any ideas on how I can fix this?

You may be missing a package that you have to install like the react-web package, you can try from a brand new create-plasmic-app that uses codegen and compare your repo with that:

Let me know if that helps!

Hi @yang, I have the @plasmicapp/react-web app installed as well. Could it be that it’s looking for whatever prettier it finds first in my node_modules?

example, randomPackageA in my node_modules that has a prettier and prettier config and the @plasmicapp/cli finds that randomPackageA and uses that prettier?

It should be just whatever is the prettier that is used in your node_modules/.bin

This problem should not be related to prettier though…