elitesuper / Vue-Ecom

An E-commerce templete made with bootstrap4 and Vue/Vuex/Vue-router.
16 stars 6 forks source link

deploy-failed #1

Closed pentos9 closed 1 year ago

pentos9 commented 1 year ago

hello, this project is great and the UI is really well-designed. i really love your work,you did a great job! however, i have problems when i deploy this project.i follow the steps on the Setup tutorial (https://github.com/elitesuper/Vue-Ecom), but i fail to deploy it.

the commands i used:

cd Vue-Ecom && npm install
npm run serve

after a few seconds, i got an empty home page and the chrome's console printed an error message:

Uncaught You must pass your app key when you instantiate Pusher.

i don't know how to set process.ENV for this project as i am new to vue and node. is did i miss something ? is process.env.VUE_APP_PUSHER_APP_KEY a must in this project?

P.S. i comment this code block in main.js, and then re-run the following command

npm run serve

it works fine after that, i can successfully visit the home page.

what i did in the main.js file:

//import Echo from 'laravel-echo'

.
.
.

// let echoconfig = new Echo({
//   broadcaster: 'pusher',
//   key: process.env.VUE_APP_PUSHER_APP_KEY,
//   wsHost: process.env.VUE_APP_HOST_PUSHER,
//   wsPort: process.env.VUE_APP_PUSHER_PORT,
//   wssPort: process.env.VUE_APP_PUSHER_PORT,
//   forceTLS: false,
//   encrypted: true,
//   disableStats: true,
//   enabledTransports: ['ws', 'wss'],
// });
// window.Echo = echoconfig
elitesuper commented 1 year ago

you have to create .env file,

VUE_APP_PUSHER_APP_KEY="yourkey"
VUE_APP_HOST_PUSHER,="yourpusher"
VUE_APP_PUSHER_PORT="yourport"