[HELP] Error using yarn

Hello !

I ran into a problem that I cannot resolve, so if anyone knows how to help me that would be awesome.

1 * I started writing a ressource, with the following files :

pillCORE/
└⎯⎯ __resource.lua
└⎯⎯ package.json
└⎯⎯ yarn.lock
└⎯⎯ node_modules/
└⎯⎯ src/
    └⎯⎯ index.js
  • __resource.lua :
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'



server_scripts {
    'src/index.js'
}

dependencies {
    'yarn'
}
  • package.json
{
    "name": "pill_core",
    "version": "0.0.0",
    "dependencies": {
        "mongoose": "^5.6.7"
    }
}
  • src/index.js
const mongoose = require('mongoose');

2 * When I add yarn and my resource to the server.cfg file and start the server, i get the following error when the resource starts :

Creating script environments for pillCORE
Error loading script src/index.js in resource pillCORE: TypeError: firstLineError.stack.split is not a function
stack:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Failed to load script src/index.js.
Started resource pillCORE

I tried to do the exact same but using other packages (‘mongodb’) and it worked, but not for mongoose.

Thank you for any help you could provide !

Ouch. Are these Node.js packages relying on a specific stack trace format and having a custom error handler or so? :open_mouth:

1 Like

Thank you for replying. Sadly, I have no idea, I have been using mongoose for a very short time and do not have much info about it.
If it may help you, here is the npm page and here are the docs …

The issue is coming from bluebird i believe, the mongoose package.json also includes bluebird alongwith rethinkdb’s having the same thing. Removing it is very hacky but it does work

1 Like

Thank you ! I decided to use the mongodb package, but I will probably try that ! :slight_smile:

No problem, was confused myself why it wasnt working then just looked for stuff stringing stack traces and such. found all of the weird stuff bluebird did, and got rid of it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.