Ironclad / rivet

The open-source visual AI programming environment and TypeScript library
https://rivet.ironcladapp.com
MIT License
2.55k stars 226 forks source link

[Bug]: yarn build fail #342

Closed yk133 closed 4 months ago

yk133 commented 5 months ago

What happened?

I modified the 'core' code. When executing yarn build on the core, an error will be reported, causing me to be unable to compile normally. However, I did not modify the files in the log below, and the dependencies were installed normally.

What was the expected functionality?

Rivet did not work as expected!

Describe your environment

Ubuntu 22.04 yarn 4.0

Relevant log output

pwd: packages/core

$ yarn build 
[19:13:51] Projects in this build: 
    * tsconfig.json

[19:13:51] Project 'tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist

[19:13:51] Building project '/home/yukun/Code/business-flow/packages/core/tsconfig.json'...

src/model/NodeBase.ts:1:29 - error TS2307: Cannot find module 'type-fest' or its corresponding type declarations.

1 import type { Opaque } from 'type-fest';
                              ~~~~~~~~~~~

src/utils/serialization/serializationUtils.ts:2:28 - error TS2307: Cannot find module 'yaml' or its corresponding type declarations.

2 import type * as yaml from 'yaml';
                             ~~~~~~

src/model/NodeGraph.ts:1:24 - error TS2307: Cannot find module 'nanoid/non-secure' or its corresponding type declarations.

1 import { nanoid } from 'nanoid/non-secure';
                         ~~~~~~~~~~~~~~~~~~~

src/model/NodeGraph.ts:3:29 - error TS2307: Cannot find module 'type-fest' or its corresponding type declarations.

3 import type { Opaque } from 'type-fest';
                              ~~~~~~~~~~~

src/model/Project.ts:1:29 - error TS2307: Cannot find module 'type-fest' or its corresponding type declarations.

1 import type { Opaque } from 'type-fest';
                              ~~~~~~~~~~~

src/utils/coerceType.ts:1:23 - error TS2307: Cannot find module 'ts-pattern' or its corresponding type declarations.

1 import { match } from 'ts-pattern';
                        ~~~~~~~~~~~~

src/utils/serialization/serialization_v3.ts:1:27 - error TS2307: Cannot find module 'lodash-es' or its corresponding type declarations.

1 import { mapValues } from 'lodash-es';
                            ~~~~~~~~~~~

src/utils/serialization/serialization_v3.ts:13:29 - error TS2307: Cannot find module 'safe-stable-stringify' or its corresponding type declarations.

13 import stableStringify from 'safe-stable-stringify';
                               ~~~~~~~~~~~~~~~~~~~~~~~

src/utils/serialization/serialization_v3.ts:132:40 - error TS7006: Parameter 'graph' implicitly has an 'any' type.

132     graphs: mapValues(project.graphs, (graph) => toSerializedGraph(graph)),
                                           ~~~~~

src/utils/serialization/serialization_v3.ts:139:50 - error TS7006: Parameter 'graph' implicitly has an 'any' type.

139     graphs: mapValues(serializedProject.graphs, (graph) => fromSerializedGraph(graph)) as Record<GraphId, NodeGraph>,
                                                     ~~~~~

src/utils/serialization/serialization_v4.ts:1:27 - error TS2307: Cannot find module 'lodash-es' or its corresponding type declarations.

1 import { mapValues } from 'lodash-es';

--------------------------
etc....
It found 281 errors.

Relevant screenshots

image

Code of Conduct

yk133 commented 5 months ago

base version 1.6.0

abrenneke commented 5 months ago

There's something weird going on with your TS installation and Yarn PnP. For some reason it's not resolving the PnP modules correctly. I can't say I know off the top of my head what causes this. You might try googling the problem and trying the fixes mentioned.

yk133 commented 5 months ago

There's something weird going on with your TS installation and Yarn PnP. For some reason it's not resolving the PnP modules correctly. I can't say I know off the top of my head what causes this. You might try googling the problem and trying the fixes mentioned.

But when I execute 'yarn dev', it can run normally, and the newly added content can also be used normally.

abrenneke commented 5 months ago

Yeah vite uses a different resolution algorithm. Build works for me though, so I'm not quite sure what's going on on your system.

yk133 commented 4 months ago

Yeah vite uses a different resolution algorithm. Build works for me though, so I'm not quite sure what's going on on your system.

OK, I solved it by adding "//@ts-nocheck" to the head of each file

abrenneke commented 4 months ago

Alright, that works!