daniel-ac-martin / NotGovUK

An implementation of the GOV.UK Design System in React that provides support for writing internal applications in addition to public ones.
https://not-gov.uk/
MIT License
27 stars 8 forks source link

First time run issue - webpack #197

Open JCBiles opened 3 years ago

JCBiles commented 3 years ago

I have followed the README and got as far as npm run dev and noticed a couple warnings around the rejected promise errors. Tried the URL but got failure and can see in the logs the errors:

➜  ccoe_prototype git:(master) ✗ npm run dev

> ccoe_prototype@1.0.0 dev
> NODE_ENV=development node-hot --fork | bunyan

10% building 1/1 modules 0 active[HMR] Waiting webpack...
Webpack Compiled with warnings.
Webpack 
WARNING in ./node_modules/keyv/src/index.js 18:14-40
Critical dependency: the request of a dependency is an expression
Webpack Compiled successfully.
[HMR] Launch assets in forked process.
[HMR] Waiting for update signal from webpack...
10% building 1/1 modules 0 active[HPM] Proxy created: /  -> http://localhost:8081
[2021-02-17T15:51:04.011Z]  INFO: ccoe_prototype-asset-proxy/31507 on HODA003: ccoe_prototype-asset-proxy listening at http://0.0.0.0:8080
(node:31507) UnhandledPromiseRejectionWarning: ReferenceError: Template is not defined
    at eval (webpack-internal:///./src/server/index.ts:47:3)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:31507) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:31507) [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.
webpack built 23b02ba35d48e3099a22 in 9769ms
ℹ 「wdm」: Compiled successfully.
No issues found.
[HPM] Error occurred while trying to proxy request / from localhost:8080 to http://localhost:8081 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while trying to proxy request /favicon.ico from localhost:8080 to http://localhost:8081 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
daniel-ac-martin commented 3 years ago

Hi @JCWBiles.

Can you tell me any more about the instructions you are following? - I can't seem to reproduce the errors you are getting.

If you just want to set up a new prototype I'd expect the following to work:

mkdir new-proptotype
cd new-prototype
git init
npm init @not-govuk prototype
npm install
git add .
git commit -m 'Initial commit'
npm run dev

Once you get the No issues found. message, you should be able to access: http://localhost:8080

daniel-ac-martin commented 3 years ago

(Feel free to omit the git commands if you don't care about version control.)

daniel-ac-martin commented 3 years ago

FWIW: The best documentation for starting a prototype is currently available at: https://hods-poc.netlify.app/get-started/start-prototype

You'd just change @hods to @not-govuk to switch to GovUK styling as opposed to Home Office.