# Parse 4.2 startup error Must Provide Source. Received: undefined

**URL:** <https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278>\
**Category:** REST API\
**Created:** [May 8, 2020, 7:24pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278 "2020-05-08T19:24:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taylorsuk](https://community.parseplatform.org/user_avatar/community.parseplatform.org/taylorsuk/32/123_2.png) [@Taylorsuk](https://community.parseplatform.org/u/Taylorsuk)\
**Post date:** [May 8, 2020, 7:24pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/1 "2020-05-08T19:24:07Z")

</div>

I am upgrading from Parse Server 3.10 to 4.2 and I am getting the following error:

```
XXXXXXX/node_modules/graphql/jsutils/devAssert.js:13
    throw new Error(message);
    ^

Error: Must provide Source. Received: undefined.
    at devAssert (XXXXXXXXX/node_modules/graphql/jsutils/devAssert.js:13:11)
    at new Parser (XXXXXXXXX/node_modules/graphql/language/parser.js:80:67)
    at Object.parse (XXXXXXXXX/node_modules/graphql/language/parser.js:35:16)
    at Object.<anonymous> (XXXXXXXXX/node_modules/graphql-tools/dist/stitching/introspectSchema.js:39:42)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

```

Anyone have any ideas how to fix it?

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [May 11, 2020, 6:05am UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/2 "2020-05-11T06:05:47Z")

</div>

Could you please share the code that you are using to initialize the Parse Server?

---

<div class="post-metadata">

**Author:** ![Taylorsuk](https://community.parseplatform.org/user_avatar/community.parseplatform.org/taylorsuk/32/123_2.png) [@Taylorsuk](https://community.parseplatform.org/u/Taylorsuk)\
**Post date:** [May 11, 2020, 6:34am UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/3 "2020-05-11T06:34:36Z")

</div>

Hi @davimacedo, here is the code

```
// Create the Parse Server API
const api = new ParseServer({
  databaseURI: databaseUri || defaultDatabaseUri,
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'XXXXXXXXXXXX',
  masterKey: process.env.MASTER_KEY || 'XXXXXXXXXXXX', // Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
  allowClientClassCreation: false,
  enableAnonymousUsers: false, // default is true, we may want this.
  verifyUserEmails: true,
  publicServerURL: `${publicServerURL}${mountPath}` || 'https://api.mydomain.com/1',
  preventLoginWithUnverifiedEmail: false,
  appName: 'XXXXXXXXX',
  // sessionLength: 31536000, // 1 year, default value
  // emailVerifyTokenValidityDuration: undefined, // default
  revokeSessionOnPasswordReset: true,
  emailAdapter: PostmarkAdapter({
    apiKey: process.env.POSTMARK_API,
    fromAddress: process.env.POSTMARK_FROM_ADDRESS,
  }),
  accountLockout: {
    duration: 5, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
    threshold: 3, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000.
  },
  customPages: {
    invalidLink: `${publicServerURL}/public/invalid.html`,
    choosePassword: `${publicServerURL}/public/change_password.html`,
    passwordResetSuccess: `${publicServerURL}/public/success.html`,
    verifyEmailSuccess: `${publicServerURL}/public/verify_email.html`,
  },
});

// Create the app and init our custom APIs
const app = coreApi.initApp(serverId);

// Serve the Parse API on the /1 URL prefix
app.use(mountPath, api);

// Final handler - Bugsnag. This handles any errors that Express catches
app.use(coreApi.bugsnagMiddleware.errorHandler);

// Start the server
const httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
  console.info(`API Server running on port ${port} for environment ${serverId}.`);
  console.info(`Connected to database: ${coreApi.utils.getSafeDbURI(databaseUri)}`);
});

// This will enable the Live Query real-time server
ParseServer.createLiveQueryServer(httpServer);

```

Many thanks

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [May 11, 2020, 11:46pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/4 "2020-05-11T23:46:08Z")

</div>

Are you also initializing the GraphQL server?

---

<div class="post-metadata">

**Author:** ![Taylorsuk](https://community.parseplatform.org/user_avatar/community.parseplatform.org/taylorsuk/32/123_2.png) [@Taylorsuk](https://community.parseplatform.org/u/Taylorsuk)\
**Post date:** [May 12, 2020, 8:58am UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/5 "2020-05-12T08:58:40Z")

</div>

No, only using REST atm.

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [May 26, 2020, 3:00am UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/6 "2020-05-26T03:00:03Z")

</div>

Sorry for the delay. Have you figured it out? Do you mind to try without loading the cloud code?

---

<div class="post-metadata">

**Author:** ![percypyan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/percypyan/32/300_2.png) [@percypyan](https://community.parseplatform.org/u/percypyan)\
**Post date:** [October 2, 2020, 12:40pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/7 "2020-10-02T12:40:44Z")

</div>

Hi, I’ve a similar problem.

I use GraphQL with the Parse server and have the graphql dependency installed to allow me to execute GraphQL queries from the Cloud Code.

The details of the situation are here : [https://stackoverflow.com/questions/63798387/upgrading-parse-server-from-v3-to-v4-triggers-error-graphql-must-provide-sourc?noredirect=1#comment112909216\_63798387](https://stackoverflow.com/questions/63798387/upgrading-parse-server-from-v3-to-v4-triggers-error-graphql-must-provide-sourc?noredirect=1#comment112909216_63798387)

If someone have any idea to solve this situation I’ll be grateful.

Details of the `yarn why graphql` command:

```auto
yarn why v1.22.4
[1/4] 🤔 Why do we have the module "graphql"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "graphql@15.1.0"
info Has been hoisted to "graphql"
info Reasons this module exists
   - Specified in "dependencies"
   - Hoisted from "parse-server#graphql"
info Disk size without dependencies: "3.23MB"
info Disk size with unique dependencies: "3.23MB"
info Disk size with transitive dependencies: "3.23MB"
info Number of shared dependencies: 0
=> Found "@types/graphql-upload#graphql@15.3.0"
info This module exists because "parse-server#apollo-server-express#apollo-server-core#@types#graphql-upload" depends on it.
info Disk size without dependencies: "3.27MB"
info Disk size with unique dependencies: "3.27MB"
info Disk size with transitive dependencies: "3.27MB"
info Number of shared dependencies: 0

```

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [October 2, 2020, 4:39pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/8 "2020-10-02T16:39:42Z")

</div>

Same problem if you install the dependencies via npm?

---

<div class="post-metadata">

**Author:** ![percypyan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/percypyan/32/300_2.png) [@percypyan](https://community.parseplatform.org/u/percypyan)\
**Post date:** [October 7, 2020, 5:03pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/9 "2020-10-07T17:03:35Z")

</div>

No! I just tried and the server starts and seems to work as expected!  
But what cause yarn to not being able to install dependencies properly?

---

<div class="post-metadata">

**Author:** ![percypyan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/percypyan/32/300_2.png) [@percypyan](https://community.parseplatform.org/u/percypyan)\
**Post date:** [October 7, 2020, 5:08pm UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/10 "2020-10-07T17:08:44Z")

</div>

Hum I just tried again with yarn but after removing yarn.lock file and that seems to be working too. Maybe it was just a problem with the existing lock file…

Some GraphQL related dependencies as been upgraded, it’s probably that.

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [October 8, 2020, 4:46am UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/11 "2020-10-08T04:46:39Z")

</div>

Nice. I’m glad you got it working.

---

<div class="post-metadata">

**Author:** ![Taylorsuk](https://community.parseplatform.org/user_avatar/community.parseplatform.org/taylorsuk/32/123_2.png) [@Taylorsuk](https://community.parseplatform.org/u/Taylorsuk)\
**Post date:** [November 15, 2020, 8:34am UTC](https://community.parseplatform.org/t/parse-4-2-startup-error-must-provide-source-received-undefined/278/12 "2020-11-15T08:34:16Z")

</div>

Yep, removing `node_modules` and `yarn.lock` allowed a successful upgrade
