Closed Lubjan closed 5 years ago
I'll try to repro this by the end of the weekend
It looks like you are using an old version of fivem-js 1.1.1
. Make sure you update to 1.3.0
. There were some issues with the examples of that version. There were some issues with the examples in 1.3.0
too though. I will fix them in an upcoming commit (a couple of minutes from the time of writing).
As for building without the FiveM builders, I suggest you checkout fivem-ts-boilerplate.
Edit: See https://github.com/d0p3t/fivem-js/tree/master/examples/typescript for updated examples. Let me know if you're still having issues
Hey, thanks for helping, I've updated my test resource with the changes from the example, but sadly I still get the same error. I've made a repo with the resource as I use it: https://github.com/Lubjan/lun-admin I will have a look at the boilerplate in the meantime
Error: (node:6464) UnhandledPromiseRejectionWarning: ReferenceError: PlayerId is not defined
at Function.get Player [as Player] (dist/server.js:356:24)
at Function.get PlayerPed [as PlayerPed] (dist/server.js:363:21)
at dist/server.js:1399:72
at Generator.next (<anonymous>)
at dist/server.js:1394:71
at new Promise (<anonymous>)
at __awaiter (dist/server.js:1390:12)
at Object.RegisterCommand [as callback] (dist/server.js:1398:44)
at citizen:/scripting/v8/main.js:96:41
Error: (node:6464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Error: (node:6464) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) are not handled will terminate the Node.js process with a non-zero exit code.
I've looked if fivem-js
is up-to-date but it seems so
PS Q:\FX1\server-data\resources\[lun]\admin> npm list fivem-js
lun-admin@1.0.0 Q:\FX1\server-data\resources\[lun]\admin
`-- fivem-js@1.3.0
Okay, I've made the same mistake as #6 and have misread "server_script "dist/index.js" instead of client_script "dist/index.js"" as use server_script instead of client_script.
Thanks for the help and sorry for bothering your again.
Hey, similar to Issue #6 I get an error when trying to execute the
/adder
example command, but it always throws the following error:I'm using the Typescript example resource, I have not tested it with the Javascript example, every dependencies and the server itself are a fresh install.
The command is the exact copy from here, the only changes I've made to the example resource are the
package.json
dependencies, the__resource.lua
so that it takes a client and a server script and added a copy of the config.js for a client and server one, contents below.__resource.lua
package.json
server.config.js:
client.config.js