Skip to content

TypeError: Parse.Schema is not a constructor #4922

Closed
@Simone-cogno

Description

@Simone-cogno

We use GitHub Issues for bugs.

If you have a non-bug question, ask on Stack Overflow or Server Fault:

If you have a vulnerability disclosure, please follow our policy available here https://github.com/parse-community/parse-server/blob/master/SECURITY.md

You may also search through existing issues before opening a new one: https://github.com/parse-community/parse-server/issues?utf8=%E2%9C%93&q=is%3Aissue

--- Please use this template. If you don't use this template, your issue may be closed without comment. ---

Issue Description

If I write the following code I receive the TypeError:

const Parse = require('parse/node').Parse;
Parse.initialize('xxxxxxxxxxxxxxxxx');
Parse.serverURL = 'http://localhost:1337/parse';
Parse.masterKey = 'xxxxxxxxxxxxxxxx';

const schema = new Parse.Schema('MyClass');
schema.addString('field');
schema.addIndex('index_name', {'field': 1});
schema.save();

Steps to reproduce

The code should produce the issue already.

Expected Results

I expect that the schema is created correctly.

Actual Outcome

TypeError: Parse.Schema is not a constructor

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.8.2
    • Operating System: ubuntu
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): localhost
  • Database

    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): localhost

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions