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

Faust App doesn't start when I run 'npm run dev' #1943

Open
1 task done
JDGHHou opened this issue Aug 24, 2024 · 15 comments
Open
1 task done

Faust App doesn't start when I run 'npm run dev' #1943

JDGHHou opened this issue Aug 24, 2024 · 15 comments
Labels
has: workaround A temporary workaround has been provided needs: reproduction This issue needs to be reproduced independently

Comments

@JDGHHou
Copy link

JDGHHou commented Aug 24, 2024

Description

I'm very interested in building headless WP apps, but I can't quite get this to work. I'm following the tutorial below, but when I get to the "npm run dev" step around 39:20 it doesn't start my dev app.

I just see:
warn - Your WordPress site is not running on https!
warn - This is a security concern as all traffic with your secret key is in plain text.
warn - Please make sure your production Faust app runs with a WordPress instance on https!
info - Faust.js v3.0.3
info - Faust.js CLI v3.0.2

https://www.youtube.com/watch?v=CuqUR1CInCg

Steps to reproduce

Follow steps in this tutorial, which are basically:
Add Faust and WGraphQL plugins to WordPress
Install NPM
Register Faust by adding Secret Key and app URL to env.local file
Try to start the app using npm run dev

Additional context

No response

@faustwp/core Version

Faust.js v3.0.3

@faustwp/cli Version

Faust.js CLI v3.0.2

FaustWP Plugin Version

1.3.2

WordPress Version

6.6.1

Additional environment details

Windows 11
Running in a stack provided by LocalWP (localwp.com) on an NGINX server using PHP 8.1.29

Please confirm that you have searched existing issues in the repo.

  • Yes
@jasonbahl
Copy link
Contributor

when I get to the "npm run dev" step around 39:20 it doesn't start my dev app.

@JDGHHou what does happen at this step? can your provide more information on what you're seeing?/

@JDGHHou
Copy link
Author

JDGHHou commented Aug 27, 2024

I see this message in the terminal:

warn - Your WordPress site is not running on https!
warn - This is a security concern as all traffic with your secret key is in plain text.
warn - Please make sure your production Faust app runs with a WordPress instance on https!
info - Faust.js v3.0.3
info - Faust.js CLI v3.0.2

Then when I try to access the application in a browser through its url, it comes back with a not found error because the application isn't running.

@jasonbahl
Copy link
Contributor

@JDGHHou if you wait a few more seconds does it show the app has started on localhost:3000?

Can you maybe share your package.json?

@josephfusco josephfusco added needs: reproduction This issue needs to be reproduced independently needs: author response Pending information from the author labels Aug 27, 2024
@jasonbahl
Copy link
Contributor

jasonbahl commented Aug 27, 2024

@JDGHHou usually you will see output after what you shared. For example:

info - Faust.js v3.1.0
info - Faust.js CLI v3.1.0

  ▲ Next.js 13.5.6
  - Local:        http://localhost:3000
  - Environments: .env.local
  - Experiments (use at your own risk):
     · scrollRestoration
     · isrMemoryCacheSize
     · incrementalCacheHandlerPath

 ✓ Ready in 1249ms

Possibly you're not waiting long enough for the app to start?

@kamalsgit
Copy link

kamalsgit commented Sep 2, 2024

Hi guys,

I too have same issues but not sure where is the issue and why the service is not starting.

error

{
"private": true,
"scripts": {
"dev": "faust dev",
"build": "faust build",
"generate": "faust generatePossibleTypes",
"start": "faust start",
"codegen": "graphql-codegen",
"watch-codegen": "graphql-codegen -w"
},
"dependencies": {
"@apollo/client": "^3.10.5",
"@faustwp/blocks": "^4.0.0",
"@faustwp/cli": "^3.0.2",
"@faustwp/core": "^3.0.1",
"@wordpress/style-engine": "^2.4.0",
"graphql": "^16.8.2",
"next": "^14.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.3.0",
"@parcel/watcher": "^2.4.1",
"@types/node": "^18.16.1",
"@types/react": "^18.3.3",
"autoprefixer": "^10.4.19",
"concurrently": "^8.2.2",
"postcss": "^8.4.40",
"tailwindcss": "^3.4.7",
"typescript": "^5.4.5"
}
}

@josephfusco
Copy link
Member

Given the original report and follow up comments, this seems to be related to npm run dev being ran on Windows.

Can you try this out with Linux? (here is one possible way to try that)

@cgar420
Copy link

cgar420 commented Sep 9, 2024

Given the original report and follow up comments, this seems to be related to npm run dev being ran on Windows.

Can you try this out with Linux? (here is one possible way to try that)

image

Does not work for me even on WSL. It worked for an older project I abandoned (not sure what faust/cli version i was using)

Now i can not get it working locally at all.

@dominio50
Copy link

Im having the same issue, running npm run dev or npm run build, or even faust dev and faust build directly will output the versions and exit.

image

node v22.9.0
npm v10.8.3

{
"name": "@faustwp/getting-started-example",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "faust dev",
"build": "faust build",
"generate": "faust generatePossibleTypes",
"stylesheet": "faust generateGlobalStylesheet",
"start": "faust start"
},
"dependencies": {
"@apollo/client": "^3.10.4",
"@faustwp/cli": "^3.1.0",
"@faustwp/core": "^3.1.0",
"@wordpress/base-styles": "^4.49.0",
"@wordpress/block-library": "^7.19.0",
"classnames": "^2.5.1",
"graphql": "^16.8.1",
"next": "^12.3.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"sass": "^1.77.3"
},
"devDependencies": {
"next-secure-headers": "^2.2.0"
},
"engines": {
"node": ">=18",
"npm": ">=8"
}
}

@dominio50
Copy link

Works totally fine on my macbook, only on windows does this issue persist

@dominio50
Copy link

Ended up downgrading my node version to 16.15.1 and seems like it doesnt work on the latest node versions on windows.

@sarkaramitabh300
Copy link

sarkaramitabh300 commented Oct 1, 2024

I am facing the same issue. The local server never starts
npm run dev

[email protected] dev
npm run generate && concurrently "faust dev" "npm run watch-codegen"

[email protected] generate
faust generatePossibleTypes

info - This project's possibleTypes schema has been updated!
[1]
[1] > [email protected] watch-codegen
[1] > graphql-codegen -w
[1]
[1] [STARTED] Parse Configuration
[1] [SUCCESS] Parse Configuration
[1] [STARTED] Generate outputs
[1] [STARTED] Generate to ./src/generated/
[1] [STARTED] Load GraphQL schemas
[0] info - Faust.js v3.0.3
[0] info - Faust.js CLI v3.0.2
[0] faust dev exited with code 0
[1] [SUCCESS] Load GraphQL schemas
[1] [STARTED] Load GraphQL documents
[1] [SUCCESS] Load GraphQL documents
[1] [STARTED] Generate
[1] [SUCCESS] Generate
[1] [SUCCESS] Generate to ./src/generated/
[1] [SUCCESS] Generate outputs
[1] ℹ Watching for changes in I:\Dev\ncmaz-faust...

node --version
v20.17.0

Windows 11 pro

npm --version
10.8.3

@jasonbahl the exact same app is running on mac without any issue

@sarkaramitabh300
Copy link

I downgraded the node and v21.5.0 worked
v20.17.0 ❌️
v20.7 ❌️
v21.5.0 ✅️

@jk2908
Copy link

jk2908 commented Oct 11, 2024

Same issue, trying multiple node versions doesn't seem to fix it for me.

@omrishooshan
Copy link

Any help? please? same issue for me

@pavlevlajic
Copy link

Use Node v21.5.0 ✅️ @jk2908 @omrishooshan

@josephfusco josephfusco added has: workaround A temporary workaround has been provided and removed needs: author response Pending information from the author labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: workaround A temporary workaround has been provided needs: reproduction This issue needs to be reproduced independently
Projects
None yet
Development

No branches or pull requests

10 participants