uhyo / jinrou

Are you a werewolf?
Other
79 stars 31 forks source link

`npm run production-build` fails #750

Closed Sunev closed 3 years ago

Sunev commented 3 years ago

npm run production-build of /front fails after I ran npm i during my last update. looks like some dependencies' update introduced new error check pattern. need help.

uhyo commented 3 years ago

Hello 🙂 unfortunately, I couldn't reproduce build failure. :cry: Do you mind providing some additional information, like node.js version, OS and also error logs?

Sunev commented 3 years ago
# \jinrou\front>npm run build

> jinrou-front@1.0.0 build
> run-s clean build:tsc build:bundle

> jinrou-front@1.0.0 clean
> rimraf ../client/static/front-assets ./dist-esm

> jinrou-front@1.0.0 build:tsc
> tsc

node_modules/@types/styled-components/ts3.7/index.d.ts:166:8 - error TS2615: Type of property 'propTypes' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, StyledComponentInnerAttrs<...> | ... 1 more ... | StyledComponentInnerAttrs<...>> | Exclude<...> | Exclude<...> | Exclude<...>> & Parti...'.

166     ): StyledComponent<
           ~~~~~~~~~~~~~~~~
167         StyledComponentInnerComponent<WithC>,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
170         A | StyledComponentInnerAttrs<WithC>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171     >;
    ~~~~~

node_modules/@types/styled-components/ts3.7/index.d.ts:166:8 - error TS2615: Type of property 'propTypes' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, any>> & Partial<...>, any> & { ...; } & WithChildrenIfReactComponentClass<...>>, "propTypes" | ... 2 more ... | "$$typeof">'.

166     ): StyledComponent<
           ~~~~~~~~~~~~~~~~
167         StyledComponentInnerComponent<WithC>,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
170         A | StyledComponentInnerAttrs<WithC>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171     >;
    ~~~~~

src/pages/game-view/footer/share-button/index.tsx:11:5 - error TS2386: Overload signatures must all be optional or required.

11     share?(data: {
       ~~~~~

Found 3 errors.

ERROR: "build:tsc" exited with 1.

# \jinrou\front>node -v
v16.6.2

# \jinrou\front>npm -v
7.20.6

on Microsoft Windows [Version 10.0.19043.1165] using master branch of uhyo/jinrou

uhyo commented 3 years ago

Thank you 🥺 seems like I need to know what npm ls @types/styled-components outputs then. :pray:

Also, running npm ci instead of npm i might fix the issue.

Sunev commented 3 years ago

npm ci doesn't fix it.

Sunev commented 3 years ago

Sorry, I didn't understand what you meant by this before.

need to know what npm ls @types/styled-components outputs

It gives

# \jinrou\front>npm ls @types/styled-components
jinrou-front@1.0.0 E:\Github\jinrou\front
`-- @types/styled-components@4.4.3

Error messages about @types/styled-components disappear after I changed it to ^5.1.14. Only the last message left.

src/pages/game-view/footer/share-button/index.tsx:11:5 - error TS2386: Overload signatures must all be optional or required.

11     share?(data: {
       ~~~~~
uhyo commented 3 years ago

Thank you for information 🙂 The last error should be fixed by the change I just pushed to master.

The root cause seems that you have different (newer) versions of packages than intended. Usually this kind of problem is fixed by running npm ci, not sure why this didn't fix your problem though... 😨

Sunev commented 3 years ago

My bad. I used npm ci after npm i without resetting package-lock.json. All error messages disappear after I copied your version of package-lock.json to my branch and run npm ci. Thank you!