4) when the app is loaded, there is this error message showing in the devtool console
runtime.DVchXwbq.umd.js:69 error in computeTemplateStringDependencies .value SyntaxError: Unexpected token . (at runtime.DVchXwbq.umd.js:47:14026)
at e.raise (runtime.DVchXwbq.umd.js:47:14026)
at e.unexpected (runtime.DVchXwbq.umd.js:48:130)
at pp$3.parseExprAtom (runtime.DVchXwbq.umd.js:42:38185)
at pp$3.parseExprSubscripts (runtime.DVchXwbq.umd.js:42:33381)
at pp$3.parseMaybeUnary (runtime.DVchXwbq.umd.js:42:32943)
at pp$3.parseExprOps (runtime.DVchXwbq.umd.js:42:31344)
at pp$3.parseMaybeConditional (runtime.DVchXwbq.umd.js:42:30987)
at pp$3.parseMaybeAssign (runtime.DVchXwbq.umd.js:42:30387)
at pp$3.parseParenAndDistinguishExpression (runtime.DVchXwbq.umd.js:42:40304)
at pp$3.parseExprAtom (runtime.DVchXwbq.umd.js:42:37468)
Apologies for the issue. Normally an environment will only be displayed but greyed out with (disabled) when the resource is missing the corresponding environment.
Can you check to see if there are any other queries in the app that are using resources that may only have prod and not staging environments enabled?
Sometimes a new query can sneak through without both environments. My second guess if this is the only query/resource in the app would be to try deleting the staging env set up and creating it again.
That is very odd that it was working fine until a day before your post. I can ask around internally to see if there might be a change to the code base that could have caused this.
Ok good to hear, it looks like that GraphQL resource is set up to work in both environments.
The point I was looking to communicate was that if there is a single other resource being used in the app, if that other resource is missing an ENV setup for 'staging' then the entire app will not be able to toggle between the environments.
It is an 'all or nothing' type of situation, where if just one query has another GraphQL or other resource that only has one ENV then it will prevent the toggling.
That black pill is very odd, I haven't seen that before. My guess is that it might be a UI bug but shouldn't effect the toggle if all Resources have both ENVs or if you are only using a single Resource with two ENVs enabled.
I did some digging and that error message in the console that you shared and that shouldn't be effecting the environment toggling either.
To further troubleshoot, if you make a new app, and only add the one resource with both environments. We could test out if that works. At times there is a resource/query sneaking into the app that doesn't have a prod config that is holding everything back
Thank you for the detailed explanation. Both environments are properly configured in all the resources used in our project. Everything was working fine until it suddenly stopped for no apparent reason.
As a temporary workaround, changing the local storage value of "appEnvironment" to "staging" resolves the issue. However, I would prefer a more robust and reliable solution. If there’s any other possible approach, I’d be open to hearing it.
Also, I’d appreciate it if your team could update the blank black box to display a more meaningful and client-friendly message. That way, we can avoid spending time troubleshooting and focus on more valuable tasks.
By the way, I created an empty app and used the resource that is configured both envs and staging is enabled. But you can still see in the picture, the black pill thingy still exists.
That is so odd that it was working fine and then suddenly stopped being able to switch environments
I am glad you were able to find a work around but I am very curious as to that is causing the issue and requiring the work around. Another work around option would be to change the URL param of the app to staging/production.
If you can DM me a JSON export of your app I can look around and test things out further to see if there is anything I can share with our Governance team that handles environments to see if we can get to the root of the issue.
I agree it is not helpful to show the empty black box, getting more details and a more descriptive message on what factors are effecting the environments would be very helpful. I can definitely relay that feedback internally
Normally, the small black pill does have a detailed error message that will let the user know which resource(s) are not configured for the disabled environment.
After doing some digging internally it seems to be a known bug where sometimes the pop up does not show the helpful message to explain why the ENV is disabled.
I can add this thread onto the bug report ticket for any updates from the engineerings currently working on it.
If you duplicate the app, does the same behavior still occur? The app may have become corrupted since you confirmed that creating a new app with the same resource is able to toggle between the ENVs.
I hope that copying the app will not bring over either bug of the ENVs not toggling or the informational pop up not explaining why the ENV switch is not enabled.
Worst case scenario you may need to either migrate the contents of an app/rebuild or wait for the bug fix on the black pill message to be resolved
Adding on that I'm experiencing the same issue, except I'm editing a Module.
The module has multiple queries imported from the Query Library, all utilizing the same MySQL DB resource which has both Production and Staging configured.
I cannot switch to the Staging env -- it says "Staging (disabled)" and gives the same empty black pill box Max shared above.
I'm also using a few "Query JSON with SQL" queries in the module. Since those are serverless, there are no resource connections or environments to configure. However, just to rule them out, I deleted those, but still got the "Staging (disabled)" issue.
On a whim, I went thru each query and hit the "Sync" button to ensure it was using the latest version of the query from the Query Library. After doing that to each one, the Staging option eventually became usable.
So it does seem like something in the app/module is getting corrupted. In my case, re-syncing the queries forced the module to overwrite whatever was corrupted with good data, eliminating the issue.
I realize this probably doesn't help @Max, as his screenshots don't appear to be using imported queries, but hopefully the info/context can help the Retool team solve his issue.
The module was built w/ Production env only first, and then we added Staging env later.
It seems like the module/apps struggle to recognize when the resources themselves are updated -- almost like the module/apps are using cached older versions of the resources.
It is such a tricky issue, when an app becomes corrupted there are a limited number of options to get things back on track but that is good to know for any other users that are importing from the query library.
Often times the best solution is either removing the queries and adding them back in again. Or if they are still not working to duplicate them and delete the original. Getting fresh data can help things to run smoothly, and as a worst case rebuilding from scratch if some part of the corruption is being duplicated over.
That makes sense, I believe there is some degree of caching that occurs and there are some users that manually invalidate the cache to trigger refreshes as needed. Another work around has been to run the 'test connection' in the resource and this often times will get things up to date.
Modules have been known to be tricky in terms of how they inherit data from queries/resources/app state so we often times recommend keeping them as simple as possible and breaking them up into small bits of boilerplate as needed.
@Jack_T
We were having the exact same issue for a couple of days.
Today, I started testing each resource and query in the app, as per @plwolfe's suggestion. Then I realized I have a couple of hidden pages for testing ideas and one of them includes a REST api which doesn't have staging env added. I added it and staging became enabled again. Hope this helps.
Empty black pill with no text issue should be definitely solved though. If I had the correct information in the first place it would be a 5min fix for us.
Hi everyone,
I’m not sure why, but the staging button is enabled again—though it’s still showing the black pill. Did any bug fixes or minor updates slip by me?
I escalated this to our engineering team so it is likely that a bug fix came through in a small patch to cloud orgs.
The ticket for the empty black error box is still on the agenda and should hopefully be fixed as well. Stay tuned for any updates on that ticket from me