Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.48 / Yarn 3] API development server/watcher not starting #4670

Closed
realStandal opened this issue Mar 6, 2022 · 5 comments · Fixed by #4695
Closed

[v0.48 / Yarn 3] API development server/watcher not starting #4670

realStandal opened this issue Mar 6, 2022 · 5 comments · Fixed by #4695
Assignees
Labels
bug/repro-available A reproduction exists and needs to be confirmed topic/cli topic/windows

Comments

@realStandal
Copy link
Collaborator

realStandal commented Mar 6, 2022

CC: @jtoar @thedavidprice


System Information

image

What's happening?

I've created a new application (upgrading an existing one has the same result) and have ran the Yarn 3 codemod.

When I start the development server, it appears the API server (and watcher) is not starting. Updating a file on the API-side once the development server has begun does not trigger a rebuild, and I get an error from the webpack-dev-server on the web:

These errors do not occur when I leave out the Yarn 3 codemod step, included below.

See below for full logs

api | [nodemon] app crashed - waiting for file changes before starting...
...
web | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8910/graphql to http://[::1]:8911/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)

Shown is the /graphql endpoint not being proxied. If I setup dbAuth, it too is not proxied.

Steps to Reproduce

See this repository for a working reproduction.

  1. yarn create redwood-app forward-bug
  2. npx @redwoodjs/codemods@canary upgrade-yarn
  3. yarn rw dev

The development server will begin, and the following is given in the logs:

api | [nodemon] 2.0.15
api | [nodemon] to restart at any time, enter `rs`
api | [nodemon] watching path(s): redwood.toml
api | [nodemon] watching extensions: js,mjs,json
api | [nodemon] starting `yarn rw-api-server-watch | rw-log-formatter`
api | 'rw-log-formatter' is not recognized as an internal or external command,
api | operable program or batch file.
api | [nodemon] app crashed - waiting for file changes before starting...
gen | (node:13352) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
gen | (Use `node --trace-warnings ...` to show where the warning was created)
gen | Generating TypeScript definitions and GraphQL schemas...
gen |
gen |       Unable to find any GraphQL type definitions for the following pointers:
gen |
gen |           - ./web/src/**/!(*.d).{ts,tsx,js,jsx}
gen |
gen |
gen | Error: Could not generate GraphQL type definitions (web)
gen |
gen |
gen |       Unable to find any GraphQL type definitions for the following pointers:
gen |
gen |           - ./web/src/**/!(*.d).{ts,tsx,js,jsx}
gen |
gen | 14 files generated
web | (node:8824) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
web | (Use `node --trace-warnings ...` to show where the warning was created)
web | assets by path static/js/*.js 2.87 MiB
web |   asset static/js/app.bundle.js 2.82 MiB [emitted] (name: app) 1 related asset
web |   asset static/js/runtime-app.bundle.js 48.9 KiB [emitted] (name: runtime-app) 1 related asset
web |   asset static/js/src_pages_NotFoundPage_NotFoundPage_js.chunk.js 3.37 KiB [emitted] 1 related asset
web | asset README.md 1.9 KiB [emitted] [from: public/README.md] [copied]
web | asset favicon.png 1.7 KiB [emitted] [from: public/favicon.png] [copied]
web | asset index.html 483 bytes [emitted]
web | asset robots.txt 24 bytes [emitted] [from: public/robots.txt] [copied]
web | Entrypoint app 2.86 MiB (2.85 MiB) = static/js/runtime-app.bundle.js 48.9 KiB static/js/app.bundle.js 2.82 MiB 2 auxiliary assets
web | orphan modules 408 KiB [orphan] 116 modules
web | runtime modules 32.8 KiB 17 modules
web | modules by path ../node_modules/ 2.3 MiB 667 modules
web | modules by path ./src/ 12.1 KiB
web |   modules by path ./src/*.js 3.44 KiB
web |     ./src/App.js 1.62 KiB [built] [code generated]
web |     ./src/Routes.js 1.82 KiB [built] [code generated]
web |   modules by path ./src/pages/ 5.49 KiB
web |     ./src/pages/FatalErrorPage/FatalErrorPage.js 3.09 KiB [built] [code generated]
web |     ./src/pages/NotFoundPage/NotFoundPage.js 2.4 KiB [built] [code generated]
web |   modules by path ./src/*.css 3.17 KiB
web |     ./src/index.css 2.63 KiB [built] [code generated]
web |     ../node_modules/@redwoodjs/core/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].oneOf[3].use[1]!./src/index.css 550 bytes [built] [code generated]
web | webpack 5.70.0 compiled successfully in 6926 ms
web | <e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8910/graphql to http://[::1]:8911/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
@callingmedic911
Copy link
Member

api | 'rw-log-formatter' is not recognized as an internal or external command,

@jtoar This may be the cause why nodemon crashes. Possibly windows specific.

@jtoar jtoar assigned jtoar and unassigned callingmedic911 Mar 6, 2022
@jtoar jtoar added bug/repro-available A reproduction exists and needs to be confirmed topic/cli topic/windows labels Mar 6, 2022
@jtoar
Copy link
Contributor

jtoar commented Mar 6, 2022

@realStandal Thanks for reporting this! We want to make sure yarn 3 works and outside CI we don't have a lot of coverage on Windows. The same set of steps works on my Mac, and I do see the same error from webpack-dev-server, though things start up. I think @callingmedic911 is onto something. What's weird is our Windows CI doesn't fail, so we can't chalk this up to Windows just yet.

I didn't add a bin proxy for rw-log-formatter 'cause yarn rw dev still worked without it, but it's worth adding it to see if it fixes what you're seeing.

This may be a bit tricky, but if you're up for it, you could do the following to test it out locally:

# build @redwoodjs/core
cd redwood/packages/core
yarn build

# generate the tarball using `yarn pack`
yarn pack

# untar it; there should be a `package` directory now
tar -xvzf ./package.tgz

# cd to where your `forward-bug` project is
cd ../forward-bug

# add the core package you just made locally by passing the path to it from your `forward-bug` project
yarn add ../redwood/packages/core/package

# confirm that it worked by running `yarn bin` and looking for `rw-log-formatter`
yarn bin
➤ YN0000: cross-env
➤ YN0000: eslint
➤ YN0000: jest
➤ YN0000: nodemon
➤ YN0000: redwood
➤ YN0000: rimraf
➤ YN0000: rw
➤ YN0000: rw-api-server-watch
➤ YN0000: rw-gen
➤ YN0000: rw-gen-watch
➤ YN0000: rw-log-formatter    # <--- this should be here now
➤ YN0000: rwfw
➤ YN0000: Done in 0s 25ms

# see if it solved the problem
yarn rw dev

@realStandal
Copy link
Collaborator Author

@jtoar @callingmedic911 Right on!

Following @jtoar's set of steps resolved the issue:

api | API listening on http://localhost:8911/
api | GraphQL endpoint at /graphql
api | 13:36:37 🌲 Server listening at http://[::]:8911
api | 13:36:37 🌲 incoming request POST xxx /graphql
api | 13:36:37 🐛 graphql-server GraphQL execution started: RedwoodVersion
api | 13:36:38 🐛 graphql-server GraphQL execution completed: RedwoodVersion
api | 13:36:38 🌲 request completed 194ms

@ofu997
Copy link

ofu997 commented May 15, 2022

I'm also on v0.48 and getting this error. Does this merge mean that later releases do not have this problem?

@jtoar
Copy link
Contributor

jtoar commented May 15, 2022

@ofu997 yes—linked PR was shipped in the v0.49.1 release:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/repro-available A reproduction exists and needs to be confirmed topic/cli topic/windows
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants