Skip to content

ReferenceError: Missing 'helmet' and 'cors' require statement #1

@11AN-CODE

Description

@11AN-CODE

Describe the bug
When running the project for the first time, the server crashes with a ReferenceError because the 'cors' and 'helmet' packages are not defined.

To Reproduce

  1. Clone the repository.
  2. Run 'npm install'.
  3. Run 'npm run dev' to start the server.

Expected behavior
The server should start successfully without any errors.

Screenshots

Image Image

Desktop (please complete the following information):

  • OS: Windows
  • Chrome
  • 11

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
The error can be fixed by adding the following lines to index.js: const cors = require('cors'); const helmet = require('helmet');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions