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

fix: explicitly use window.OC global in app config #197

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

st3iny
Copy link
Contributor

@st3iny st3iny commented Jun 14, 2024

(Production) bundles generated by vite break if the optimizer generates a const declaration that randomly has the name OC.

Uncaught ReferenceError: can't access lexical declaration 'OC' before initialization

A lexical variable was accessed before it was initialized. This happens within any scope (global, module, function, or block) when variables declared with let or const are accessed before the place where they are declared has been executed.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init#what_went_wrong

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny added the 3. to review Ready to review label Jun 14, 2024
@st3iny st3iny requested a review from susnux June 14, 2024 07:49
@st3iny st3iny self-assigned this Jun 14, 2024
@st3iny
Copy link
Contributor Author

st3iny commented Jun 14, 2024

/backport to stable1

@susnux
Copy link
Contributor

susnux commented Jun 14, 2024

🤯

@susnux susnux merged commit 76e403c into main Jun 14, 2024
12 checks passed
@susnux susnux deleted the fix/window-oc branch June 14, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Ready to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants