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

RunContext does not work #667

Closed
PoliceFighter761 opened this issue Apr 26, 2023 · 16 comments · Fixed by #765
Closed

RunContext does not work #667

PoliceFighter761 opened this issue Apr 26, 2023 · 16 comments · Fixed by #765

Comments

@PoliceFighter761
Copy link

PoliceFighter761 commented Apr 26, 2023

When specifying the RunContext property it simply does not get applied. Here is my setup:

image

with the following in the .meta

{
    "properties": {
      "RunContext": {
        "Enum": 2
      }
    }
}

Which results in a Script with the RunContext set to legacy instead of Client:
image

In the mean time I have made a work-around extra plugin which applies the RunContext instead. It uses the following code:

foundClientScript.RunContext = 2;

which makes me believe that it can not be a permissions issue because the above code works.

Is there any way I can properly do this with rojo or do I have to wait for the time being? Am I doing something wrong?

I am using Rojo 7.3.0 but it did not work in the version prior either.

@shirovian
Copy link

shirovian commented May 13, 2023

I have this issue as well, it's been like this for a while, I recall it working at some point but I don't remember when, why or how.

{
    "properties": {
        "RunContext": {
            "Enum": 2
        }
    }
}

Weirdly enough the RunContext property does show up in the Rojo local web portal:

Maybe it's an issue with the studio plugin not syncing it in?

@Ozzypig
Copy link

Ozzypig commented May 31, 2023

In Rojo 7.2.1, this seems to be working for me:

Main.server.lua paired with this Main.meta.json:

{
	"properties": {
		"RunContext": "Client"
	}
}

@shirovian
Copy link

In Rojo 7.2.1, this seems to be working for me:

Main.server.lua paired with this Main.meta.json:

{
	"properties": {
		"RunContext": "Client"
	}
}

Weird, I have Rojo 7.2.1 as well. I tried copy-pasting that meta file with files Some.server.lua and Some.meta.json, I got an unknown property error stopping me from starting Rojo at all:

image

image

Using the explicit enum format doesn't error and appears in the Rojo tree (as shown before) but instead silently doesn't apply to my script, this is all really confusing.

@sasial-dev
Copy link
Contributor

Fixed in 7.3.0, this issue can be closed.

@PoliceFighter761
Copy link
Author

When I created the issue, I had already updated it to 7.3.0, and it didn't work. (I stated that in the original issue, too)

@shirovian
Copy link

shirovian commented Jun 3, 2023

Fixed in 7.3.0, this issue can be closed.

I updated to 7.3.0 and tried using the implicit format again as such:

{
    "properties": {
        "RunContext": "Client"
    }
}

Same file names and setup as before, it no longer crashes like it did when I used 7.2.1, but still RunContext does not get applied:

image

image

The issue persists and this was already mentioned at the bottom of this issue's description. :(
I have no idea what this could be, do any of us?

@Barocena
Copy link
Contributor

@Zodanim @PoliceFighter761
it works fine on both serve and build

image

@GammaWhiskey
Copy link

Found out why this issue is only happening to some people:

I had this issue when using the Roblox model version of the plugin, but switching to the plugin version managed by the VS Code extension fixed the issue.

@kennethloeffler
Copy link
Member

Found out why this issue is only happening to some people:

I had this issue when using the Roblox model version of the plugin, but switching to the plugin version managed by the VS Code extension fixed the issue.

Hey @GammaWhiskey, does this happen with the plugin on GitHub releases? The one on Roblox.com? Both?

@GammaWhiskey
Copy link

Happens with the one on Roblox.com, not the plugin on GitHub releases

@PoliceFighter761
Copy link
Author

PoliceFighter761 commented Jun 25, 2023

Can confirm that this only happens on the toolbox plugin. After installing the plugin on the release page the RunContext gets properly synced.

@shirovian
Copy link

shirovian commented Jul 5, 2023

I got a chance to test the plugin on the GitHub releases page just now and can confirm the issue is gone, thanks everyone!

image

I was letting the VS Code Rojo plugin manage the studio plugin for me, so it seems it installs the wrong version.

@ambergamefam
Copy link

ambergamefam commented Jul 24, 2023

@LPGhatguy Can you look into updating the Roblox plugin? This has caused a bunch of confusion, and makes it hard to want to make the switch to using RunContext when people will sync up your source code incorrectly.

@Dekkonot
Copy link
Member

@ambergamefam LPG is no longer contributing to Rojo, so the existing plugin likely won't be updated. We have a new plugin located here that people should install and the documentation on Rojo's website has been updated to reflect that. I know that it's frustrating, and it's not the solution we would have liked, but it is what it is. ☹️

To prevent this from ever becoming an issue again, the new plugin is published by a Roblox group rather than any one user, so if Boatbomber, me, or anyone else step away from Rojo it won't impact users again. That's unfortunately all we can do.

@ambergamefam
Copy link

ambergamefam commented Jul 26, 2023

Oh, gotcha! Was confused since the old plugin is named "Rojo 7" and Rojo is still in version 7.

image

I'm noticing the new Rojo plugin has a moderated thumbnail, just FYI. It's visible in the Plugin Management panel, but it's stretched:

image

@boatbomber
Copy link
Member

That's just Roblox being Roblox. The image is fine, but various pages you view have issues.

Dashboard Page:
image

Marketplace Page:
image

Library Page:
image

Kampfkarren pushed a commit that referenced this issue Sep 23, 2023
Resolves #667

This PR:

- Introduces a new field in the project file: `scriptType` which has the
default value of `Class` (in parity with previous versions), but can
also be `RunContext`.
- This is then passed to `InstanceContext` from the `Project` struct.
- This then changes the RunContext in the lua `snapshot_middleware`

---------

Co-authored-by: Micah <dekkonot@rocketmail.com>
Dekkonot added a commit to UpliftGames/rojo that referenced this issue Jan 11, 2024
Resolves rojo-rbx#667

This PR:

- Introduces a new field in the project file: `scriptType` which has the
default value of `Class` (in parity with previous versions), but can
also be `RunContext`.
- This is then passed to `InstanceContext` from the `Project` struct.
- This then changes the RunContext in the lua `snapshot_middleware`

---------

Co-authored-by: Micah <dekkonot@rocketmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants