choojs/create-choo-app

Cannot run a choo project

alvarezgarcia opened this issue Β· 7 comments

I've installed create-choo-app today (v1.6.1)

I've run

$ create-choo-app choo-test $ cd choo-test $ npm start

Visited localhost:8080 and it crashes with
TypeError: Cannot read property 'DOMCONTENTLOADED' of undefined

Commented app.use(require('choo-service-worker')()) on index.js and restarted

Now it crashes telling that can't find yo-yo module.

I try to install it with npm and again restart

`app.route('/', require('./views/main'))
^

TypeError: app.route is not a function
`

My node version is v7.6.0.

Thanks in advance

Hi @raichuk! Thanks for reporting this issue.

I just tried the following:

npx create-choo-app .
npm start

I did not see the errors you saw, but I am using npm@5.3.0 and node@8.3.0.

Can you please check which version of npm you were using above as well? There have been a lot of serious npm bugs since the npm@5 release.

This might have something to do with SSR.

I just tried using node@7.6.0 (bundled with npm@4.1.2) and was unable to reproduce @raichuk's error.

Edit: Browser may also be an issue. I was using latest Chrome.

Side Note: Perhaps a bit odd to use choo@next and bankai@next instead of a specific version or version range. Might also be helpful to output create-choo-app version when it runs (default create behavior may soon be npx create-choo-app) (yarn did this on every run and I appreciated it).

Also: bankai inspect is very cool πŸ‘

Expand details below for terminal log.

~/dev/lab $ nvm i 7.6
######################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v7.6.0 (npm v4.1.2)
~/dev/lab $ npm -v
4.1.2
~/dev/lab $ npm i -g create-choo-app
/Users/ng/.nvm/versions/node/v7.6.0/bin/create-choo-app -> /Users/ng/.nvm/versions/node/v7.6.0/lib/node_modules/create-choo-app/bin.js
/Users/ng/.nvm/versions/node/v7.6.0/lib
└─┬ create-choo-app@1.6.1
  β”œβ”€β”¬ ansi-escape-sequences@3.0.0
  β”‚ └─┬ array-back@1.0.4
  β”‚   └── typical@2.6.1
  β”œβ”€β”¬ async-collection@1.0.1
  β”‚ β”œβ”€β”€ map-limit@0.0.1
  β”‚ β”œβ”€β”€ run-parallel@1.1.6
  β”‚ β”œβ”€β”€ run-parallel-limit@1.0.3
  β”‚ β”œβ”€β”€ run-series@1.1.4
  β”‚ └── run-waterfall@1.1.3
  β”œβ”€β”€ dedent@0.7.0
  β”œβ”€β”€ minimist@1.2.0
  β”œβ”€β”¬ mkdirp@0.5.1
  β”‚ └── minimist@0.0.8
  β”œβ”€β”¬ pump@1.0.2
  β”‚ β”œβ”€β”¬ end-of-stream@1.4.0
  β”‚ β”‚ └── once@1.4.0
  β”‚ └─┬ once@1.3.3
  β”‚   └── wrappy@1.0.2
  └─┬ rimraf@2.6.1
    └─┬ glob@7.1.2
      β”œβ”€β”€ fs.realpath@1.0.0
      β”œβ”€β”€ inflight@1.0.6
      β”œβ”€β”€ inherits@2.0.3
      β”œβ”€β”¬ minimatch@3.0.4
      β”‚ └─┬ brace-expansion@1.1.8
      β”‚   β”œβ”€β”€ balanced-match@1.0.0
      β”‚   └── concat-map@0.0.1
      └── path-is-absolute@1.0.1

~/dev/lab $ create-choo-app choo-app
Creating a new Choo app in /Users/ng/dev/lab/choo-app.

Creating file package.json…

Installing packages, this might take a couple of minutes.
Installing choo@next, choo-log, choo-devtools, choo-service-worker, and tachyons…
Installing bankai@next, and standard…

Creating file .gitignore…
Creating file README.md…
Creating file index.js…
Creating file sw.js…
Creating file views/main.js…
Creating file views/404.js…
Creating file manifest.json…
Creating file assets/icon.png…

Initializing git

App created in /Users/ng/dev/lab/choo-app.
All done, good job! πŸš‚πŸš‹πŸš‹

The following commands are available:
  npm start        Start the development server
  npm test         Lint, validate deps & run tests
  npm run build    Compile all files to dist/
  npm run inspect  Inspect the bundle dependencies

Do you enjoy using this software? Become a backer:
https://opencollective.com/choo
~/dev/lab $ cd choo-app/
~/dev/lab/choo-app (master) $ npm start

> choo-app@1.0.0 start /Users/ng/dev/lab/choo-app
> bankai start index.js

10:48:24 ✨  bankai bundle:js
10:48:24 ✨  bankai Started for index.js on http://localhost:8080
10:48:25 ✨  bankai bundle:css
10:48:31 ✨  bankai <-- GET xxx /sw.js 1.0KB
10:48:31 ✨  bankai --> GET 200 /sw.js 967B 6ms

Thanks to all for the quick responses.
@ungoldman my version of create-choo-app is 1.6.1, and here is my package.json which shows bankai and choo versions.

  "name": "choo-test",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "build": "bankai build index.js",
    "inspect": "bankai inspect index.js",
    "start": "bankai start index.js",
    "test": "standard && test-deps",
    "test-deps": "dependency-check . && dependency-check . --extra --no-dev -i tachyons"
  },
  "dependencies": {
    "choo": "^5.0.0-1",
    "choo-devtools": "^1.3.1",
    "choo-log": "^7.2.1",
    "choo-service-worker": "^2.2.0",
    "tachyons": "^4.8.1"
  },
  "devDependencies": {
    "bankai": "^9.0.0-1",
    "standard": "^10.0.3"
   }
}

I can confirm that with node v8.4.0 it works perfectly.
Thanks to all.

Should we add an engines requirement to package.json?

@bcomnes not a bad idea πŸ‘