marko-js / examples

55 stars 36 forks source link

TypeError in Vite HTTP Example #25

Closed ajcwebdev closed 2 years ago

ajcwebdev commented 2 years ago

Reproduction

Download the vite-http template.

npx @marko/create marko-app --template vite-http
cd marko-app
npm run dev

After opening localhost:3000, the terminal and browser display the following error:

TypeError: Cannot read property 'headers' of undefined
    at new Accepts (/Users/ajcwebdev/marko-app/node_modules/accepts/index.js:37:22)
    at Proxy.Accepts (/Users/ajcwebdev/marko-app/node_modules/accepts/index.js:34:12)
    at Module.send (/src/send.js:15:27)
    at handler (src/index.js:7:6)
    at file:///Users/ajcwebdev/marko-app/index.js:34:15
ajcwebdev commented 2 years ago

Figured it out, the issue is you need to have Node 16 installed, Node 14 will fail. Would be useful to mention the Node requirements somewhere in the README.