HospitalRun / hospitalrun

Monorepo that holds all of HospitalRun's v2 projects.
https://hospitalrun.io
MIT License
907 stars 335 forks source link

Error while building the project #363

Open anaymalpani opened 4 years ago

anaymalpani commented 4 years ago
✓ Creating entry file 8.6 secs
(typescript) Error: D:/anaym/projects/node/f/hospitalrun/packages/components/src/components/Layout/Container.tsx(33,25): semantic error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ReplaceProps<"symbol", BsPrefixProps<"symbol"> & ContainerProps>>): Container<"symbol">', gave the following error.
    Type '"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | ... 158 more ... | undefined' is not assignable to type '"symbol" | undefined'.
      Type '"object"' is not assignable to type '"symbol" | undefined'.
  Overload 2 of 2, '(props: ReplaceProps<"symbol", BsPrefixProps<"symbol"> & ContainerProps>, context?: any): Container<"symbol">', gave the following error.
    Type '"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | ... 158 more ... | undefined' is not assignable to type '"symbol" | undefined'.
      Type '"object"' is not assignable to type '"symbol" | undefined'.
Error: D:/anaym/projects/node/f/hospitalrun/packages/components/src/components/Layout/Container.tsx(33,25): semantic error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ReplaceProps<"symbol", BsPrefixProps<"symbol"> & ContainerProps>>): Container<"symbol">', gave the following error.
    Type '"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | ... 158 more ... | undefined' is not assignable to type '"symbol" | undefined'.
      Type '"object"' is not assignable to type '"symbol" | undefined'.
  Overload 2 of 2, '(props: ReplaceProps<"symbol", BsPrefixProps<"symbol"> & ContainerProps>, context?: any): Container<"symbol">', gave the following error.
    Type '"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | ... 158 more ... | undefined' is not assignable to type '"symbol" | undefined'.
      Type '"object"' is not assignable to type '"symbol" | undefined'.
    at error (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\rollup\dist\shared\node-entry.js:5400:30)
    at throwPluginError (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\rollup\dist\shared\node-entry.js:11878:12)
    at Object.error (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\rollup\dist\shared\node-entry.js:12912:24)
    at Object.error (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\rollup\dist\shared\node-entry.js:12081:38)
    at RollupContext.error (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\tsdx\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:17194:30)
    at D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\tsdx\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:24994:23
    at arrayEach (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\tsdx\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:534:11)
    at forEach (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\tsdx\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:9360:14)
    at printDiagnostics (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\tsdx\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:24967:5)
    at Object.transform (D:\anaym\projects\node\f\hospitalrun\packages\components\node_modules\tsdx\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:29049:17)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @hospitalrun/components@1.8.1 build: `tsdx build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @hospitalrun/components@1.8.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\anaym\AppData\Roaming\npm-cache\_logs\2020-05-30T16_06_01_227Z-debug.log

Your Environment

jackcmeyer commented 4 years ago

@anaymalpani could you please provide steps to reproduce?

matteovivona commented 4 years ago

@anaymalpani do you use Windows or have you built with yarn?

anyapawar commented 4 years ago

I am facing the same issue- how did you fix this problem?

anyapawar commented 4 years ago

I have node v14.4.0, MacOS, yarn v1.19.1:

I completed the steps:

git clone git@github.com:HospitalRun/hospitalrun.git cd hospitalrun git submodule update --init --recursive yarn yarn workspaces run build (And received this error during run build)

matteovivona commented 4 years ago

This is a yarn workspace issue when using a monorepo. It's an issue of low priority because all separate submodules build correctly. The team is informed of this issue but needs time to solve it. Any contributions are welcome.

reidmeyer commented 4 years ago

Could you clarify how to build all of the submodules to get the application to run? @tehKapa

fox1t commented 4 years ago

Hi! I am going to to look into this ASAP and hopefully fix the problem definitely! @reidmeyer you are right: we miss the documentation that explains how to use all the modules without mono repo. Let’s try to understand what are the main steps that are needed to use all modules in a stand alone way.

reidmeyer commented 4 years ago

Glad to hear @fox1t.

My guess would be to run "yarn run build" inside each package itself, but I think that is the same thing as running yarn workspaces run build. When I do this, I get errors with components and frontend.

That documentation would be super helpful.

jackcmeyer commented 4 years ago

@reidmeyer for documentation on how to contribute to the individual modules: https://github.com/HospitalRun/hospitalrun/blob/master/.github/CONTRIBUTING.md

fox1t commented 4 years ago

Hi! I've looked into this. The real problem is TypeScript version > 3.9.x that changed how union types work. Our dependency is listed like "typescript": "~3.8.2" so it wouldn't be updated to a newer minor that brakes. Do you have TS globally installed?

reidmeyer commented 4 years ago

@fox1t I don't think I have it installed globally, as tsc isn't recognized. Although it could have been installed by visual studio. I do have a C:\Program Files (x86)\Microsoft SDKs\TypeScript\versions\03.08.03.00, but you say it only breaks at 3.9.x. This is using yarn so it might be the monorepo bugs still. image

fox1t commented 4 years ago

Could be a hoisting problem! Ok, lets see if my last commits fixes it! Thanks again.

reidmeyer commented 4 years ago

Just updating you: with the current commits, I'm getting the same errors as before.

I see you're working on it though, and I didn't run the MOST recent commit, so I will test again later!

NPM14 throws me errors on "yarn" command:

image

image

image

NPM12 gets passed the yarn command, but then on workspaces build it similarly fails with the overload:

image

mraqkhan commented 4 years ago

I am facing the same issue. Did someone get it working? How to fix this?

matteovivona commented 4 years ago

We are looking into a new solution for the management of the monorepo... we don't have an ETA

Razi321 commented 3 years ago

i'm still getting this error , anyone solved it ?

matteovivona commented 3 years ago

Unfortunately, yes. It is not easy to find a tool for the management of this complicated software

Razi321 commented 3 years ago

so how can I R run this project on my local machine ? i've tried what's available but nothing works

matteovivona commented 3 years ago

You have to run hospitalrun-server and hospitalrun-frontend separately