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

Does not function #7

Open
ChaseKellow opened this issue Sep 26, 2023 · 2 comments
Open

Does not function #7

ChaseKellow opened this issue Sep 26, 2023 · 2 comments

Comments

@ChaseKellow
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [x] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

follow the steps given

Any log messages given by the failure

Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

  • options.allowedHosts[0] should be a non-empty string.

Expected/desired behavior

That it works

OS and Version?

Windows 11

Versions

Mention any other details that might be useful

Deleting the proxy line in package.json or modifying it to

"options": {
    "allowedHosts": ["localhost", ".localhost"],
    "proxy": "http://localhost:3001"
  }

opens the webpage but returns the error

FATAL_ERROR: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot GET /api/get-speech-token</pre> </body> </html> 

or modifying the env file instead to include

DANGEROUSLY_DISABLE_HOST_CHECK=true

Opens the webpage but instead returns

FATAL_ERROR: Proxy error: Could not proxy request /api/get-speech-token from localhost:3000 to http://localhost:3001/ (ECONNREFUSED).

Thanks! We'll be in touch soon.

@nirvana0311
Copy link

It doesn't work for me as well.

@waasiq
Copy link

waasiq commented Nov 1, 2023

You need to enable CORS for this project to work add these lines in index.js of server to make it work:

Install cors dependency: npm i cors

Import the cors in the top of the code:

const cors = require('cors')

Use cors with express:

const app = express();
app.use(cors())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants