I have a bunch of apex classes i am trying to push to my scratch org. I get an Invalid type error for a lot of my referenced classes that contained in the classes i am trying to push.

If i put one of the problematic classes in the forceignore fle, nothing seems to get pushed. It's almost as if the Type classes are being ignored/not pushed for some reason.

My forceignore looks like










public class MyClass {


public class MyOtherClass {
    MyClass class;

When i try to run

sfdx force:source:push --json --loglevel fatal --forceoverwrite

i get a compile error:

Invalid type: MyClass
  • Can you post what one of those classes look like and what throws an error? – Jayant Das Mar 25 at 18:10
  • @JayantDas what information would you need to know? They are fairly large classes. I'll post a generic example in the OP – Ben Arnao Mar 25 at 18:17
  • Yeah, a generic example will work here which can provide as what lines are causing issues. – Jayant Das Mar 25 at 18:17
  • @JayantDas i added some more info – Ben Arnao Mar 25 at 18:29
  • Is that the only error you see in console? Are there any other relevant message that could be helpful here? – Jayant Das Mar 25 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.