Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Code Editor crash #9

Closed
luisherranz opened this issue May 5, 2022 · 2 comments
Closed

Code Editor crash #9

luisherranz opened this issue May 5, 2022 · 2 comments
Labels
wontfix This will not be worked on

Comments

@luisherranz
Copy link
Member

The Code Editor is crashing because of this throw:

export const useBlockEnvironment = () => {
  try {
    const env = useReactContext(EnvContext); // Throws in save
    if (env === "frontend") return "frontend";
    return "edit";
  } catch (e) {
  return "save";
  }
};

That's a temporary hack to distinguish between the different contexts and obviously we won't try to push it to Gutenberg, so no need to fix. I've just opened the issue so other people finding this problem knows what it is.

@luisherranz luisherranz added the wontfix This will not be worked on label May 5, 2022
@michalczaplinski
Copy link
Collaborator

Thanks for documenting this! I just came across this very issue 🙂

@luisherranz
Copy link
Member Author

Closed as we're not actively working on this experiment anymore, and this works fine in the Directives Hydration.

@luisherranz luisherranz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants