-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Open
Labels
need more infoFurther information is requestedFurther information is requested
Description
Vue version
3.5.26
Link to minimal reproduction
Can not provide
Steps to reproduce
compile vue 3 application into single js file, side load it into an existing site where buffer already exists on the window object. error is thrown.
Problem source
let buffer = []; //OFFENDING VAR
function setDevtoolsHook$1(hook, target) {
var _a2, _b2;
devtools$1 = hook;
if (devtools$1) {
devtools$1.enabled = true;
buffer.forEach( ({event: event2, args}) => devtools$1.emit(event2, ...args));
buffer = [];
} else if (// handle late devtools injection - only do this if we are in an actual
// browser environment to avoid the timer handle stalling test runner exit
// (#4815)
typeof window !== "undefined" && // some envs mock window but not fully
window.HTMLElement && // also exclude jsdom
// eslint-disable-next-line no-restricted-syntax
!((_b2 = (_a2 = window.navigator) == null ? void 0 : _a2.userAgent) == null ? void 0 : _b2.includes("jsdom"))) {
const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
replay.push( (newHook) => {
setDevtoolsHook$1(newHook, target);
}
);
setTimeout( () => {
if (!devtools$1) {
target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
buffer = [];
}
}
, 3e3);
} else {
buffer = [];
}
}What is expected?
vue variables placed on global scope should have a vue_ prefix or something to ensure there are no clashes with other frameworks, libs, or source using the same names
What is actually happening?
console error breaking application
Uncaught SyntaxError: Identifier 'buffer' has already been declared
System Info
Chrome latestAny additional comments?
No response
Metadata
Metadata
Assignees
Labels
need more infoFurther information is requestedFurther information is requested