Skip to content

TypeError: Configuration is not a constructor in server.js when using OpenAI API #3

@Deafveloper

Description

@Deafveloper

While attempting to deploy the backend of the Tom Riddle’s Diary project on Render, a TypeError: Configuration is not a constructor encountered in the server.js file. This error occurs when instantiating the Configuration class from the OpenAI package.

Steps to Reproduce:

1.	Deploy the project on Render using the provided server.js file.
2.	Observe the deployment logs where the following error is thrown:
	- TypeError: Configuration is not a constructor
3.	The error occurs at the line where the Configuration class is instantiated.

Expected Behavior:

The Configuration class should be correctly instantiated, allowing the server to start and handle requests to the OpenAI API without errors.

Actual Behavior:

The server fails to start, and the above TypeError is thrown, preventing the application from functioning correctly.

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