wpengine / faustjs

Faust.js™ - The Headless WordPress Framework
https://faustjs.org
Other
1.41k stars 126 forks source link

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

Open JDGHHou opened 2 weeks ago

JDGHHou commented 2 weeks ago

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.

jasonbahl commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

@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?

jasonbahl commented 2 weeks ago

@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 commented 1 week ago

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 commented 1 week ago

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 commented 4 days ago

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.