remake / remake-cli

Create interactive web apps with just HTML (Remake CLI)
https://remaketheweb.com/
MIT License
392 stars 27 forks source link

ReferenceError: URL is not defined #15

Closed kewp closed 3 years ago

kewp commented 4 years ago

Describe the bug Got an error when following the remake getting started steps.

To Reproduce Steps to reproduce the behavior:

npm install -g remake
remake create remake-proj
cd remake-proj
npm run dev

Expected behavior Can see server

Screenshots

[nodemon] [nodemon] 1.19.4
[nodemon] [nodemon] to restart at any time, enter `rs`
[nodemon] [nodemon] watching dir(s): **\*
[nodemon] [nodemon] watching extensions: html,hbs,sass,css,js,png,gif,jpg,json
[nodemon] [nodemon] starting `node server.js`
[nodemon]
[nodemon]
[nodemon]
[nodemon]  #####################################################################
[nodemon]  #                                                                   #
[nodemon]  #           Visit your Remake app: http://localhost:3000            #
[nodemon]  #                                                                   #
[nodemon]  #####################################################################
[nodemon] (node:13384) UnhandledPromiseRejectionWarning: ReferenceError: URL is not defined
[nodemon]     at c:\users\karlp\tst\remake-proj\_remake\main.js:82:28
[nodemon]     at Layer.handle [as handle_request] (c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\layer.js:95:5)
[nodemon]     at trim_prefix (c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\index.js:317:13)
[nodemon]     at c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\index.js:284:7
[nodemon]     at Function.process_params (c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\index.js:335:12)
[nodemon]     at next (c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\index.js:275:10)
[nodemon]     at c:\users\karlp\tst\remake-proj\_remake\main.js:71:3
[nodemon]     at Layer.handle [as handle_request] (c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\layer.js:95:5)
[nodemon]     at trim_prefix (c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\index.js:317:13)
[nodemon]     at c:\users\karlp\tst\remake-proj\node_modules\express\lib\router\index.js:284:7
[nodemon] (node:13384) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[nodemon] (node:13384) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[asset-bundler-watch] Terminate batch job (Y/N)? Terminate batch job (Y/N)? Terminate batch job (Y/N)? npm run nodemon exited with code 1
--> Sending SIGTERM to other processes..
[asset-bundler-watch] npm run asset-bundler-watch exited with code 1

Desktop (please complete the following information):

I'm using Node v8.12.0

panphora commented 3 years ago

@kewp Can you try the latest version and confirm if this is solved or not?

kewp commented 3 years ago

Hi @panphora . Long time no speak.

I did try it again and got a different error. See below.

C:\Users\karl>npm install -g remake
C:\Users\karl\AppData\Roaming\npm\remake -> C:\Users\karl\AppData\Roaming\npm\node_modules\remake\bin\remake
+ remake@2.3.1
added 156 packages from 107 contributors in 29.408s

C:\Users\karl>cd tst

C:\Users\karl\tst>remake create remake-proj
√ Creating new project.
√ Tidy up new project directory.
v1.0.0
? Choose a starter template Default starter
√ Cloning https://github.com/remake/default-starter
√ Installing npm dependencies.
√ Setting up .remake

    Your new Remake project has been created!

    1. Go into your new project's directory:
    $ cd remake-proj

    2. Start up the dev server:
    $ npm run dev

    3. Load the example app in a browser:
    http://localhost:3000

    4. Check out the quickstart:
    https://remaketheweb.com/quickstart

warning: LF will be replaced by CRLF in app/assets/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/css/_remake.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/js/remake-init.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/js/vendor/Sortable.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/js/vendor/crostini.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/data/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/layouts/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/layouts/default.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/app-index.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/index.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/forgot.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/login.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/reset.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/signup.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/partials/README.md.
The file will have its original line endings in your working directory
error: pathspec 'commit'' did not match any file(s) known to git

C:\Users\karl\tst>
panphora commented 3 years ago

Thank you for trying again! I think the problem is this line:

// remake-cli/utils/commands.js
shell.exec("git add . && git commit -m 'Initial commit' --quiet");

Based on this Stack Overflow answer, I think windows doesn't like single quotes.

I'll push a fix now.

panphora commented 3 years ago

@kewp Can you try updating Remake and try again? Also, which version of Windows are you on? I tested on Windows 10 the other day and it worked, so just curious.

kewp commented 3 years ago

@panphora yup it works now

C:\Users\karl\tst>remake create remake-pro
√ Creating new project.
√ Tidy up new project directory.
v1.0.0
? Choose a starter template Default starter
√ Cloning https://github.com/remake/default-starter
√ Installing npm dependencies.
√ Setting up .remake

    Your new Remake project has been created!

    1. Go into your new project's directory:
    $ cd remake-pro

    2. Start up the dev server:
    $ npm run dev

    3. Load the example app in a browser:
    http://localhost:3000

    4. Check out the quickstart:
    https://remaketheweb.com/quickstart

warning: LF will be replaced by CRLF in app/assets/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/css/_remake.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/js/remake-init.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/js/vendor/Sortable.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/assets/js/vendor/crostini.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/data/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/layouts/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/layouts/default.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/app-index.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/index.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/forgot.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/login.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/reset.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/pages/user/signup.hbs.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in app/partials/README.md.
The file will have its original line endings in your working directory

C:\Users\karl\tst>cd remake-pro

C:\Users\karl\tst\remake-pro>npm run dev

> remake-pro@1.0.0 dev C:\Users\karl\tst\remake-pro
> nodemon _remake/server.js --watch ./

[nodemon] 1.19.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): **\*
[nodemon] watching extensions: html,hbs,css,js,png,gif,jpg,json
[nodemon] starting `node _remake/server.js`

 Visit your Remake app: http://localhost:3000
 Check this log to see the requests made by the app, as you use it.

::1 - - [28/Nov/2020:20:33:51 +0000] "GET / HTTP/1.1" 200 686
::1 - - [28/Nov/2020:20:33:51 +0000] "GET /favicon.ico HTTP/1.1" 404 13
::1 - - [28/Nov/2020:20:33:58 +0000] "GET /favicon.ico HTTP/1.1" 404 13
::1 - - [28/Nov/2020:20:33:58 +0000] "GET / HTTP/1.1" 200 686

app

panphora commented 3 years ago

Whooo! 🙌 Awesome! Let me know if you want any help getting started or you can come join us on Discord. Thank you so much for the help!