cameronjs icon indicating copy to clipboard operation
cameronjs copied to clipboard

Errors on windows when running `cameronjs dev`

Open jacebenson opened this issue 2 years ago • 2 comments

Hey I was trying out cameronjs on my windwos machine and I followed the steps listed there to get started.

jaceb@home MINGW64 ~/git
$ yarn global add cameronjs
[1/4] Resolving packages...
[2/4] Fetching packages...
(contined till done)

Great installed.

jaceb@home MINGW64 ~/git
$ cameronjs new ./camerontest
CameronJS v0.5.7 ready! Let's build your app.

-------------------------------------------
|  Creating directory structure
-------------------------------------------
(continued a bunch of outputs)
Let's start a web server and get to work:

←[34m  cd ./camerontest←[0m
←[34m  cameronjs dev
←[0m
The page that opens in your browser will help
you get started. Happy coding!

Great, looks like I should be running soon.

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs dev
Try `cameronjs --help` for usage options

Well that's not running... lets look at help

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs --help
Try `cameronjs --help` for usage options
Usage cli.js <command> [options]

Commands:
  cli.js new [path]      Creates a new CameronJS app
  cli.js destroy [path]  Removes a CameronJS app
  cli.js dev             Start a web server and watch codebase for changes
  cli.js build           Builds production-ready assets into /publish
  cli.js serve           Starts a web server to serve the /publish directory
  cli.js netlify         Starts a netlify dev instance for local testing of
                         functions

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number

Okay lets try the other commands

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs dev .
Try `cameronjs --help` for usage options

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs dev ./
Try `cameronjs --help` for usage options

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs serve
Try `cameronjs --help` for usage options

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs serve ./
Try `cameronjs --help` for usage options

jaceb@home MINGW64 ~/git/camerontest (master)
$ cameronjs serve ~
Try `cameronjs --help` for usage options

Okay, maybe the package.json will have a hint on how to get this running

  "scripts": {
    "build": "webpack && postcss --verbose code/stylesheets/application.pcss -o publish/stylesheets/application.css",
    "clean": "del 'publish/!(images|favicon.*)'",
    "dev": "$npm_execpath serve & $npm_execpath watch",
    "netlify": "$npm_execpath watch & netlify dev",
    "rebuild": "$npm_execpath clean && $npm_execpath build",
    "serve": "live-server --watch=./publish --mount=/:./publish --entry-file='publish/404.html'",
    "watch": "webpack --watch & postcss --verbose code/stylesheets/application.pcss -o publish/stylesheets/application.css --watch"
  },

Looks like I can just run dev here or serve yarn serve works but it renders

<html lang="en"><head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>


</body></html>

the /code/html/index.html has a bunch of stuff but I can't get that to render here.

Oh I'll try to build first then to serve. Success

jacebenson avatar Sep 07 '21 06:09 jacebenson

Thanks for taking the time to write all this up! I don't have a Windows machine to test any fixes and, honestly, no one is really using this besides me, so I can't justify the time it would take to diagnose and fix!

cannikin avatar Sep 07 '21 17:09 cannikin

I was able to get it running w/ yarn build && yarn serve.

The syntax is different than I'm used to, but I thoguht i'd give it a full try.

I'll try to add some PR's to add the details about layouts docs here.

jacebenson avatar Sep 07 '21 18:09 jacebenson