Open
Description
Vue version
3.3.4
Link to minimal reproduction
https://github.com/tragid/vue-default-export-error/tree/vue-3.3.4-emit-errors-2
Steps to reproduce
- Create enum:
export enum InputType {
INPUT = 'input-event',
CHANGE = 'change-event',
BLUR = 'blur-event',
FOCUS = 'focus-event',
}
- Create component with defineEmits:
interface ComponentEmits {
(e: 'click-event', value: string): void;
(e: InputType.BLUR, value: string): void;
(e: InputType.FOCUS, value: string): void;
(e: InputType.INPUT, value: string): void;
(e: InputType.CHANGE, value: string): void;
}
const emit = defineEmits<ComponentEmits>();
- Facing runtime errors on DEV and not setting up emits on PROD.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "focus-event" but it is neither declared in the emits option nor as an "onFocus-event" prop.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "input-event" but it is neither declared in the emits option nor as an "onInput-event" prop.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "change-event" but it is neither declared in the emits option nor as an "onChange-event" prop.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "blur-event" but it is neither declared in the emits option nor as an "onBlur-event" prop.
What is expected?
Can setup events with imported enum
What is actually happening?
Facing runtime errors on DEV and not setting up emits on PROD.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "focus-event" but it is neither declared in the emits option nor as an "onFocus-event" prop.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "input-event" but it is neither declared in the emits option nor as an "onInput-event" prop.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "change-event" but it is neither declared in the emits option nor as an "onChange-event" prop.
runtime-core.esm-bundler.js:41 [Vue warn]: Component emitted event "blur-event" but it is neither declared in the emits option nor as an "onBlur-event" prop.
System Info
No response
Any additional comments?
No response