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?