Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platformWorkspaceApi EnclosingTabId Throws "n.connect is not a function" Errors #921

Closed
1 task done
BatemanVO opened this issue Mar 5, 2024 · 2 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@BatemanVO
Copy link
Contributor

Summary

Using the sample workspaceOpenSubtab component found in this repo, "n.connect is not a function" errors are thrown

Salesforce Org Type

Sandbox

Steps To Reproduce

Steps to Reproduce

I've created a repo with the code I am using at this link.

I've gone into my personal Sandbox and created a new custom object, EnclosingTab__c.

  • Create a single record with no fields populated
  • Navigate to that record in a console environment
  • Setup -> Edit Page
  • Add the enclosingTabLogger component to the page layout:
    sample-page-layout
  • Save and activate the page layout
  • Experience the error:
    not-a-function-error

Current Behavior

"n.connect is not a function" error is thrown when attempting to use the EnclosingTabId method imported from lightning/platformWorkspaceApi

Expected Behavior

EnclosingTabId should provide the Id of the tab the component is loaded on

Relevant Log Output

TypeError: n.connect is not a function
    at Array.<anonymous> (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:44171)
    at https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:45485
    at bo (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:45488)
    at nr (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:30482)
    at tr (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:30043)
    at rr (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:30607)
    at https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:29955
    at tr (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:29979)
    at rr (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:30607)
    at br (https://static.lightning.force.com/usa770s.sfdc-8tgtt5/auraFW/javascript/MFZGMnNxcWxxQVZkaERsVUY3RzNmZ3ZrcWo2bHVYSXBmeGJiLUx2eVNiWWcyNDguMTAuMy01LjAuOQ/aura_prod.js:51:35186)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@BatemanVO BatemanVO added the bug Something isn't working label Mar 5, 2024
Copy link
Contributor

github-actions bot commented Mar 5, 2024

Thank you for posting this issue. 🙇🏼‍♂️
We will come back to you shortly.

@BatemanVO
Copy link
Contributor Author

As noted in the documentation, issue is because Lightning Web Security needs to be enabled in the Org instead of Lightning Locker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants