panel icon indicating copy to clipboard operation
panel copied to clipboard

[BUG] Admin view doesn't load

Open Miniontoby opened this issue 4 months ago • 8 comments

Current Behavior

I am using the develop branch at the moment. I have builded all the files and such.

The client page works, but then I switch over to the admin view and it doesn't work!

An error was encountered by the application while rendering this view. Try refreshing the page.

Then I opened up the console:

TypeError: Cannot read properties of undefined (reading 'deserialize')
    at s (AdminRouter-90e44635.js:5:164650)
    at new Mn (AdminRouter-90e44635.js:5:164857)
    at Mn.deserialize (AdminRouter-90e44635.js:5:168523)
    at AdminRouter-90e44635.js:5:169019
TypeError: Cannot read properties of undefined (reading 'deserialize')
    at s (AdminRouter-90e44635.js:5:164650)
    at new Mn (AdminRouter-90e44635.js:5:164857)
    at Mn.deserialize (AdminRouter-90e44635.js:5:168523)
    at AdminRouter-90e44635.js:5:169019

Expected Behavior

I was expecting to see the admin view.

Steps to Reproduce

  1. Download the develop branch
  2. Install all dependencies
  3. Make sure to setup everything like normal
  4. Build the panel
  5. Make sure to have created an admin user
  6. Log in
  7. Try open the admin view

Panel Version

1.11.5+ (develop branch)

Is there an existing issue for this?

  • [X] I have searched the existing issues before opening this issue.
  • [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.

Miniontoby avatar Feb 17 '24 11:02 Miniontoby

The develop branch is not intended for installation at this moment. Please use 1.0-develop

Jelcoo avatar Feb 17 '24 11:02 Jelcoo

Oke, I have switched to the 1.0-develop branch!

I will check if I can access admin view

Miniontoby avatar Feb 17 '24 11:02 Miniontoby

It doesn't want to build.

(This error message is no longer helpful here, please see below for the current error [it is the same, but I do not need to have it posted twice])

Miniontoby avatar Feb 17 '24 12:02 Miniontoby

You have used NPM, not yarn

PadowYT2 avatar Feb 17 '24 12:02 PadowYT2

Oke, so using yarn I get the same errors!

Because it still spams me with:

react/no-unknown-property: Unknown property 'css' found

when running yarn build or yarn watch

When using yarn build:production this is not a problem, but then you still/again get the errors from earlier (please note I removed them from above and posted the 'new' errors below this post)

Miniontoby avatar Feb 17 '24 12:02 Miniontoby

with yarn build:production I get this error:

ERROR in resources/scripts/components/elements/CopyOnClick.tsx:35:15
TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '{ className: string; onClick: (e: React.MouseEvent<HTMLElement>) => void; }' is not assignable to parameter of type 'Partial<unknown> & Attributes'.
      Object literal may only specify known properties, and 'className' does not exist in type 'Partial<unknown> & Attributes'.
    33 |         ? React.Children.only(children)
    34 |         : React.cloneElement(React.Children.only(children), {
  > 35 |               className: classNames(children.props.className || '', 'cursor-pointer'),
       |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    36 |               onClick: (e: React.MouseEvent<HTMLElement>) => {
    37 |                   copy(String(text));
    38 |                   setCopied(true);

ERROR in resources/scripts/components/elements/Translate.tsx:4:19
TS2707: Generic type 'TransProps' requires between 1 and 4 type arguments.
    2 | import { Trans, TransProps, useTranslation } from 'react-i18next';
    3 |
  > 4 | type Props = Omit<TransProps, 't'>;
      |                   ^^^^^^^^^^
    5 |
    6 | export default ({ ns, children, ...props }: Props) => {
    7 |     const { t } = useTranslation(ns);

ERROR in resources/scripts/components/elements/Translate.tsx:7:19
TS2589: Type instantiation is excessively deep and possibly infinite.
     5 |
     6 | export default ({ ns, children, ...props }: Props) => {
  >  7 |     const { t } = useTranslation(ns);
       |                   ^^^^^^^^^^^^^^^^^^
     8 |
     9 |     return (
    10 |         <Trans t={t} {...props}>

ERROR in resources/scripts/components/server/console/chart.ts:74:5
TS2322: Type 'Omit<DeepMergeRecordsDefaultHKTInternalProps<[_DeepPartialObject<CoreChartOptions<"line"> & ElementChartOptions<"line"> & PluginChartOptions<"line"> & DatasetChartOptions<"line"> & ScaleChartOptions<...> & LineControllerChartOptions>, { ...; }], Readonly<...>, Readonly<...>>, "__proto__">' is not assignable to type '_DeepPartialObject<CoreChartOptions<"line"> & ElementChartOptions<"line"> & PluginChartOptions<"line"> & DatasetChartOptions<"line"> & ScaleChartOptions<...> & LineControllerChartOptions>'.
  Types of property 'scales' are incompatible.
    Type '{ [x: string]: { type?: "time" | undefined; title?: { display?: boolean | undefined; align?: "end" | "start" | "center" | undefined; text?: string | (string | undefined)[] | undefined; color?: string | ... 2 more ... | undefined; font?: { ...; } | ... 2 more ... | undefined; padding?: number | ... 1 more ... | undef...' is not assignable to type '_DeepPartialObject<{ [key: string]: ScaleOptionsByType<keyof CartesianScaleTypeRegistry>; }> | undefined'.
      Type '{ [x: string]: { type?: "time" | undefined; title?: { display?: boolean | undefined; align?: "end" | "start" | "center" | undefined; text?: string | (string | undefined)[] | undefined; color?: string | ... 2 more ... | undefined; font?: { ...; } | ... 2 more ... | undefined; padding?: number | ... 1 more ... | undef...' is not assignable to type '_DeepPartialObject<{ [key: string]: ScaleOptionsByType<keyof CartesianScaleTypeRegistry>; }>'.
        'string' index signatures are incompatible.
          Type '{ type?: "time" | undefined; title?: { display?: boolean | undefined; align?: "end" | "start" | "center" | undefined; text?: string | (string | undefined)[] | undefined; color?: string | { ...; } | { ...; } | undefined; font?: { ...; } | ... 2 more ... | undefined; padding?: number | ... 1 more ... | undefined; } | ...' is not assignable to type '_DeepPartialObject<{ type: "time"; } & Omit<CartesianScaleOptions, "max" | "min"> & { min: string | number; max: string | number; suggestedMin: string | number; ... 5 more ...; ticks: { ...; }; }> | ... 4 more ... | undefined'.
            Type '{ type?: "category" | undefined; title?: { display?: boolean | undefined; align?: "end" | "start" | "center" | undefined; text?: string | (string | undefined)[] | undefined; color?: string | { ...; } | { ...; } | undefined; font?: { ...; } | ... 2 more ... | undefined; padding?: number | ... 1 more ... | undefined; ...' is not assignable to type '_DeepPartialObject<{ type: "time"; } & Omit<CartesianScaleOptions, "max" | "min"> & { min: string | number; max: string | number; suggestedMin: string | number; ... 5 more ...; ticks: { ...; }; }> | ... 4 more ... | undefined'.
              Type '{ type?: "category" | undefined; title?: { display?: boolean | undefined; align?: "end" | "start" | "center" | undefined; text?: string | (string | undefined)[] | undefined; color?: string | { ...; } | { ...; } | undefined; font?: { ...; } | ... 2 more ... | undefined; padding?: number | ... 1 more ... | undefined; ...' is not assignable to type '_DeepPartialObject<{ type: "category"; } & Omit<CartesianScaleOptions, "max" | "min"> & { min: string | number; max: string | number; labels: string[] | string[][]; }>'.
                Types of property 'labels' are incompatible.
                  Type '(string | undefined)[] | ((string | undefined)[] | undefined)[] | undefined' is not assignable to type '_DeepPartialArray<string> | _DeepPartialArray<string[]> | undefined'.
                    Type '((string | undefined)[] | undefined)[]' is not assignable to type '_DeepPartialArray<string> | _DeepPartialArray<string[]> | undefined'.
                      Type '((string | undefined)[] | undefined)[]' is not assignable to type '_DeepPartialArray<string>'.
                        Type '(string | undefined)[] | undefined' is not assignable to type 'string | undefined'.
                          Type '(string | undefined)[]' is not assignable to type 'string'.
    72 |
    73 | function getOptions(opts?: DeepPartial<ChartOptions<'line'>> | undefined): ChartOptions<'line'> {
  > 74 |     return deepmerge(options, opts || {});
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    75 | }
    76 |
    77 | type ChartDatasetCallback = (value: ChartDataset<'line'>, index: number) => ChartDataset<'line'>;
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Miniontoby avatar Feb 17 '24 13:02 Miniontoby

Please remove node_modules, package-lock.json, then run only yarn commands

PadowYT2 avatar Feb 18 '24 10:02 PadowYT2

I had done that prior to running the build!

And yes I have done it again and still the same result.

Miniontoby avatar Feb 18 '24 15:02 Miniontoby

Can someone help me?!

I did remove the npm related files and reinstalled and rebuilded, but nothing helped!

And I have waited 3 weeks already.

Miniontoby avatar Mar 07 '24 11:03 Miniontoby

Please just install Pterodactyl the normal way, the admin side isn't made React, so building won't help

PadowYT2 avatar Mar 07 '24 12:03 PadowYT2

I installed the develop-1.0 branch! I do not want to install the normal/release version! I am working on an issue and I need to make a PR, so I really need to use git!

But yeah, the problem is that the develop-1.0 branch doesn't build

Miniontoby avatar Mar 08 '24 11:03 Miniontoby

Remove all your panel files and start clean again. Also, for quicker help you should visit the Discord (#api-and-modding channel)

Boy132 avatar Mar 11 '24 08:03 Boy132

Seems like that works. But I need to put my changes back in now...

I have done that, I have literally added every change again and no problems accured... The diff is actually completely the same and still the old one doesn't want to build and the new one does... so this is really strange....

But the issue is resolved, I guess, so I will close it.

Miniontoby avatar Mar 14 '24 07:03 Miniontoby