1

I am about to upload a lightning component added to my package that embeds a canvas app. While trying to upload this package I am getting this error : The Lightning Component Definition in this managed package must be marked 'access=global'.

Why is that? I know that default is public if not specified which is what I went for. Also, this is what is meant by Public: Only components in the same namespace can set the value of this attribute. So I dont know why does it need to be global when releasing a managed package.?

Thank you.

2 Answers 2

4

A component's public and global access per documentation states:

public - Available within your org only. This is the default access value.

global - Available in all orgs.

So if you are releasing a component as part of a package, then you definitely want your component to be accessible outside of your org, for which you would need to mark it with a global access. The documentation on the access control mentions this in detail.

Mark your resources, such as a component, with access="global" to make the resource usable outside of your own org. For example, if you want a component to be usable in an installed package or by a Lightning App Builder user or a Community Builder user in another org.

1
  1. As a good practice, always set component level access to GLOBAL if you wish to expose them outside your org

Mark your resources, such as a component, with access="global" to make the resource usable outside of your own org. For example, if you want a component to be usable in an installed package or by a Lightning App Builder user or a Community Builder user in another org.

  1. If you plan on making the attributes accessible through the .design file, you will must need to set access to GLOBAL.
  2. If you have any global attribute then you would need to setup it as global.

One more related thread: Where to use access=GLOBAL in Lightning components in managed packages

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .