BubbleDK / bub-mdt

bub-mdt is a FiveM Mobile Data Terminal resource, written in TypeScript and React.
GNU General Public License v3.0
97 stars 45 forks source link

[BUG] MDT wont open #10

Closed MrAalen closed 2 months ago

MrAalen commented 2 months ago

Describe the bug

The MDT wont open using command nor the default keybind "M"

To Reproduce

Steps to reproduce the behavior:

  1. Downloaded the code as zip
  2. Installed both sql files
  3. Tried the following in separate attempts:
    • Commented out placeholder="2023-03-12" in both CreateBoloModal.tsx and CriminalCard.tsx
    • Added the type placeholder?: string; in interface DatePickerInputProps within Mantine
    • I had to do either one of them due to a building error where the placeholder type wasnt defined. As you can see in image-1.
  4. Built web using bun i and bun run build
  5. Tried opening the MDT with both the command /mdt and the default keybind "M"
  6. See error in image-2

Error

[    186532] [b3095_GTAProce]        CrBrowserMain/ Uncaught (in promise) Error: Unknown variable dynamic import: ../../../node_modules/dayjs/locale/no.js (@bub-mdt/web/build/assets/index-1fe46fe1.js:87)
[    186657] [b3095_GTAProce]        CrBrowserMain/ TypeError: Cannot read properties of null (reading 'map') (@bub-mdt/web/build/assets/index-1fe46fe1.js:87)
[    186657] [b3095_GTAProce]        CrBrowserMain/ Uncaught TypeError: Cannot read properties of null (reading 'map') (@bub-mdt/web/build/assets/index-1fe46fe1.js:85)
[    186657] [b3095_GTAProce]        CrBrowserMain/ Uncaught (in promise) TypeError: Cannot read properties of null (reading 'announcements') (@bub-mdt/web/build/assets/index-1fe46fe1.js:692)

Expected behavior

I expected the MDT to open up.

Screenshots

Image-1 image Image-2 image

Additional context

I am using Qbox, ox_lib and oxmysql. I have also tried restarting the server multiple times.

BubbleDK commented 2 months ago

I don't know why "placeholder" wouldn't be a part of the interface. I've never encountered that error when building the source code. Try use PNPM to build the web source instead of bun, and check if you still get the same issues?

Or just use the existing build files in the web folder.

MrAalen commented 2 months ago

I'll try, but I moved away from pnpm for this exact reason, it doesn't control the typings properly (which is the whole point of typescript). The placeholder lines has a red underline in vscode as well, which means there is something wrong somewhere. I tried with normal npm as well, same building error. I could use the prebuilt one, but I really want to do some customization, and for that I need to able to build.

BubbleDK commented 2 months ago

Well it seems something went wrong when installing node_modules. Remove those, and try installing them again using pnpm and afterwards build it too. That's what i use myself, and i've never experienced those issues though.

Let me know what you figure out!

MrAalen commented 2 months ago

Conclusion; using pnpm will fix the building issue, but will not fix the root cause which is a undefined type placeholder.

LikeManTV commented 2 months ago

I have the same issue with undefined type placeholder. But this worked for me:

BubbleDK commented 2 months ago

I've removed the placeholders. Thanks for the report.