2

My latest issue in my adoption of DX (it's been a challenging week!)... first some context: I developed my app on a non-namespaced dev org, before I had ventured to DX. Knowing I would need to use a namespace for my managed package, I added namespace to the dev org and modified my Lightning code using wrapper classes and a namespace prefix sniffer -- no hardcoding of namespace (thanks @Mohith).

I've migrated the app from my original dev org into SFDX and a Git repo (thanks Christophe Coenraets), and I can push source to a non-namespaced scratch org. However, I get dozens (hundreds?) of errors when I try to push to a namespaced scratch org. Most of the errors start with "Variable does not exist..." or "Field does not exist..." and go on to name one of my custom objects/fields which will have the namespace pre-pended.

Here are some sample errors:

force-app/main/default/classes/IncomingSMS_MMS.cls                                  Variable does not exist: Conversation__c (54:35)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Invalid type: Conversation__c (11:9)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Variable does not exist: Conversations (17:13)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Invalid type: Conversation__c (17:31)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              DML requires SObject or SObject list type: List<Conversation__c> (22:9)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Field does not exist: Conversation__c on p7g__Member__c (28:29)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Field does not exist: Conversation__c on p7g__Member__c (31:29)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Variable does not exist: Id (52:83)
force-app/main/default/classes/IncomingSMS_MMSTest.cls                              Variable does not exist: Id (57:70)
force-app/main/default/classes/SaveConversationMember.cls                           Invalid type: Conversation__c (20:9)
force-app/main/default/classes/SaveConversationMember.cls                           Variable does not exist: newConversation (28:9)
force-app/main/default/aura/ConversationFeed/ConversationFeed.cmp                   Invalid definition for p7g:GetConversationList: null
force-app/main/default/aura/NewConversation/NewConversation.cmp                     Invalid definition for p7g:SaveConversationMember: null
force-app/main/default/aura/Harness/Harness.app                                     Invalid definition for p7g:SaveConversationMember: null
force-app/main/default/aura/ConvoDisplay/ConvoDisplay.cmp                           Invalid definition for p7g:GetUrlPreviews: null
force-app/main/default/aura/MessageTile/MessageTile.cmp                             Invalid definition for p7g:GetUrlPreviews: null
force-app/main/default/aura/MessageEntry/MessageEntry.cmp                           Invalid definition for p7g:SaveSendSMS: null
force-app/main/default/aura/MessageFeed/MessageFeed.cmp                             Invalid definition for p7g:GetUrlPreviews: null

FYI, p7g is the namespace.

I can't find docs on this issue, hoping you may have insight or can point me to documentation on it.

BTW, let me take a brief moment to say thanks for all the learning I get here. Especially @MohithShrivastava @DavidReed @sfdcfox. I owe you!


Some additional errors -- actually these are among the first in sequence:

force-app/main/default/objects/Conversation__c/Conversation__c.object-meta.xml      Conversation_Record_Page does not exist or is not a valid override for action View.
force-app/main/default/objects/Member__c/fields/Conversation__c.field-meta.xml      referenceTo value of 'Conversation__c' does not resolve to a valid sObject type (81:13)
force-app/main/default/objects/Message__c/fields/Conversation__c.field-meta.xml     referenceTo value of 'Conversation__c' does not resolve to a valid sObject type (81:13)
force-app/main/default/objects/Member__c/listViews/All.listView-meta.xml            In field: columns - no CustomField named Member__c.Conversation__c found (253:16)
force-app/main/default/objects/Message__c/listViews/All.listView-meta.xml           In field: columns - no CustomField named Message__c.Conversation__c found (241:16)

force-app/main/default/aura/ProtonText/ProtonTextController.js                      0Ad540000009Vr2: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Binary data encountered in a JsonStreamReader that was not constructed to support binary data [1, 1]
force-app/main/default/aura/ProtonText/ProtonTextHelper.js                          0Ad540000009Vr2: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Binary data encountered in a JsonStreamReader that was not constructed to support binary data [1, 1]
force-app/main/default/aura/ProtonText/ProtonText.css                               0Ad540000009Vr2: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Binary data encountered in a JsonStreamReader that was not constructed to support binary data [1, 1]
force-app/main/default/aura/ProtonText/ProtonText.design                            0Ad540000009Vr2: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Binary data encountered in a JsonStreamReader that was not constructed to support binary data [1, 1]

Browse other questions tagged or ask your own question.