구름IDE에서 vue 프로젝트 생성하면 나타나는 main.js에 mitt를 사용하기 위해 다음과 같이 ">>"가 있는 라인을 추가하면 아래와 같은 콘솔 에러가 발생하는데요,
[main.js]
import Vue from 'vue'
import App from './App.vue'
>> import mitt from 'mitt'
>> let emitter=mitt();
Vue.config.productionTip = false
>> Vue.config.globalProperties.emitter = emitter;
new Vue({
render: function (h) { return h(App) },
}).$mount('#app')
[Console Error]
Uncaught TypeError: Cannot set properties of undefined (setting 'emitter')
at eval (main.js?56d7:8:1)
at Module../src/main.js (app.js:1348:1)
at __webpack_require__ (app.js:849:30)
at fn (app.js:151:20)
at Object.1 (app.js:1361:18)
at __webpack_require__ (app.js:849:30)
at checkDeferredModules (app.js:46:23)
at app.js:925:18
at app.js:928:10
강의에서 본 것처럼 creatApp이 없어서 그런것인지, 아니면 다른 원인이 있는지 궁금합니다. 또 이 상태에서도 emitter를 사용할 수 있는 방법이 있는지도 알고 싶습니다