Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more πŸš€
https://budibase.com
Other
22.47k stars 1.55k forks source link

Dev environment: Cannot find module '@budibase/types' #11068

Closed jolice closed 1 year ago

jolice commented 1 year ago

Checklist

https://github.com/Budibase/budibase/discussions/10415 didn't help me, still get the same error.

Hosting

Deploying dev environment on Linux.

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"

Describe the bug

Dev environment won't start:

@budibase/shared-core: [1] 
@budibase/shared-core: [0] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] 
@budibase/shared-core: [0] 1:08:19 PM - Found 3 errors. Watching for file changes.
@budibase/shared-core: [1] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] 
@budibase/shared-core: [1] 1:08:19 PM - Found 3 errors. Watching for file changes.

To Reproduce

npm install -g yarn lerna jest
git clone https://github.com/Budibase/budibase.git && cd budibase
cd budibase
yarn dev

Expected behavior

Dev environment is deployed normally.

jolice commented 1 year ago

upd: I've figured out that an issue is caused by missing Python 3.0 and make. I've installed both packages, ran yarn build and now get the error:

failed to load config from /opt/bb-dev/budibase/packages/builder/vite.config.js
       error during build:
       Error: Cannot find module '@sveltejs/vite-plugin-svelte'
       Require stack:
       - /opt/bb-dev/budibase/packages/builder/vite.config.js
       - /root/.nvm/versions/node/v14.21.3/lib/node_modules/vite/dist/node/chunks/dep-e8f070e8.js
           at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
           at Function.Module._load (internal/modules/cjs/loader.js:774:27)
           at Module.require (internal/modules/cjs/loader.js:1003:19)
           at require (internal/modules/cjs/helpers.js:107:18)
           at Object.<anonymous> (/opt/bb-dev/budibase/packages/builder/vite.config.js:36:33)
           at Module._compile (internal/modules/cjs/loader.js:1114:14)
           at Object._require.extensions.<computed> [as .js] (file:///root/.nvm/versions/node/v14.21.3/lib/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:64524:24)
           at Module.load (internal/modules/cjs/loader.js:979:32)
           at Function.Module._load (internal/modules/cjs/loader.js:819:12)
           at Module.require (internal/modules/cjs/loader.js:1003:19)
jolice commented 1 year ago

I will reinstall OS and try everything from scratch.

mike12345567 commented 1 year ago

Hi @jolice - you need to run the yarn setup command the first time you run the development environment to create initial builds, then you can run yarn dev from that point forward.

jolice commented 1 year ago

Hi @mike12345567 ,

I've reinstalled Debian 11, executed all commands with accordance to Debian environment setup instruction (https://github.com/Budibase/budibase/blob/0d429daac4263f9c816812f0499c7ad22b14110b/docs/DEV-SETUP-DEBIAN.md), and ran the following commands:

yarn setup
yarn dev

Still, I get the same error:

@budibase/types: [1] 
@budibase/shared-core: [0] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] 
@budibase/shared-core: [1] 3:21:25 PM - Found 3 errors. Watching for file changes.
@budibase/shared-core: [0] 
@budibase/shared-core: [0] 3:21:25 PM - Found 3 errors. Watching for file changes.
@budibase/types: [0] 
@budibase/types: [0] 3:21:34 PM - Found 0 errors. Watching for file changes.
@budibase/types: [1] 
@budibase/types: [1] 3:21:35 PM - Found 0 errors. Watching for file changes.
3:22:12 PM - Starting compilation in watch mode...
@budibase/types: [0] 
@budibase/types: [1] 3:22:12 PM - Starting compilation in watch mode...
@budibase/types: [1] 
@budibase/shared-core: [1] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] 
@budibase/shared-core: [1] 3:22:21 PM - Found 3 errors. Watching for file changes.
@budibase/shared-core: [0] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] 
@budibase/shared-core: [0] 3:22:22 PM - Found 3 errors. Watching for file changes.
@budibase/types: [1] 
@budibase/types: [1] 3:22:29 PM - Found 0 errors. Watching for file changes.
@budibase/types: [0] 
@budibase/types: [0] 3:22:30 PM - Found 0 errors. Watching for file changes.
@budibase/string-templates: rollup v2.79.1
@budibase/string-templates: bundles src/index.mjs β†’ dist/bundle.mjs...

No process is started on port :3000 or :10000, either.

Running:

yarn clean

And then yarn setup && yarn dev doesn't help too.

The same problem occurs on my laptop (MacOS).

jolice commented 1 year ago

If it's important, I also get the following warnings during yarn setup:

warning Resolution field "@budibase/backend-core@0.0.0" is incompatible with requested version "@budibase/backend-core@2.7.36-alpha.9"
warning Resolution field "@budibase/shared-core@0.0.0" is incompatible with requested version "@budibase/shared-core@2.7.36-alpha.9"
warning Resolution field "@budibase/string-templates@0.0.0" is incompatible with requested version "@budibase/string-templates@2.7.36-alpha.9"
warning Resolution field "@budibase/types@0.0.0" is incompatible with requested version "@budibase/types@2.7.36-alpha.9"
warning Resolution field "@budibase/backend-core@0.0.0" is incompatible with requested version "@budibase/backend-core@2.7.36-alpha.9"
warning Resolution field "@budibase/shared-core@0.0.0" is incompatible with requested version "@budibase/shared-core@2.7.36-alpha.9"
warning Resolution field "@budibase/string-templates@0.0.0" is incompatible with requested version "@budibase/string-templates@2.7.36-alpha.9"
warning Resolution field "@budibase/types@0.0.0" is incompatible with requested version "@budibase/types@2.7.36-alpha.9"
mike12345567 commented 1 year ago

Hi @jolice - what docker processes do you have running behind this? Is there a budibase/proxy container running correctly?

jolice commented 1 year ago

@mike12345567 hi,

No docker processes are running in the background:

root@597169:~# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Now, after running yarn build I get the following:

root@597169:~/budibase# yarn build
yarn run v1.22.19
$ yarn nx run-many -t=build
$ /root/budibase/node_modules/.bin/nx run-many -t=build

    βœ”  nx run @budibase/server:build (12s)
    βœ”  nx run @budibase/worker:build (6s)

    βœ–  nx run @budibase/string-templates:build
$ tsc && rollup -c
       /bin/sh: 1: rollup: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    βœ”  nx run @budibase/types:build (29s)
    βœ”  nx run @budibase/shared-core:build (15s)

    βœ–  nx run @budibase/backend-core:build
$ rimraf dist/
$ tsc -p tsconfig.build.json
       jest.config.ts(4,26): error TS2694: Namespace '"/root/budibase/node_modules/@jest/types/build/Config"' has no exported member 'InitialProjectOptions'.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

 >  NX   Ran target build for 10 projects (1m)

    βœ”    4/6 succeeded [0 read from cache]

    βœ–    2/6 targets failed, including the following:
         - nx run @budibase/string-templates:build
         - nx run @budibase/backend-core:build

   Hint: Try "nx view-logs" to get structured, searchable errors logs in your browser.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
root@597169:~/budibase# 
mike12345567 commented 1 year ago

Hi @jolice - you'll need to run a top level yarn by the look of things to install all required dependencies - the steps for getting setup to contribute are here: https://github.com/Budibase/budibase/blob/develop/docs/CONTRIBUTING.md

jolice commented 1 year ago

Thanks @mike12345567, let me do it and write back.

jolice commented 1 year ago

Hi @mike12345567, I've followed all the steps listed in the instruction (https://github.com/Budibase/budibase/blob/develop/docs/CONTRIBUTING.md), but the error persists.

I've ran top-level yarn, then yarn-setup, and a still get the error.

root@597169:~/budibase# yarn setup
yarn run v1.22.19
$ git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev
Docker installed - continuing.
$ node scripts/syncProPackage.js
[1/4] Resolving packages...
warning Resolution field "@budibase/backend-core@0.0.0" is incompatible with requested version "@budibase/backend-core@2.7.36-alpha.9"
warning Resolution field "@budibase/shared-core@0.0.0" is incompatible with requested version "@budibase/shared-core@2.7.36-alpha.9"
warning Resolution field "@budibase/string-templates@0.0.0" is incompatible with requested version "@budibase/string-templates@2.7.36-alpha.9"
warning Resolution field "@budibase/types@0.0.0" is incompatible with requested version "@budibase/types@2.7.36-alpha.9"
warning Resolution field "@budibase/backend-core@0.0.0" is incompatible with requested version "@budibase/backend-core@2.7.36-alpha.9"
warning Resolution field "@budibase/shared-core@0.0.0" is incompatible with requested version "@budibase/shared-core@2.7.36-alpha.9"
warning Resolution field "@budibase/string-templates@0.0.0" is incompatible with requested version "@budibase/string-templates@2.7.36-alpha.9"
warning Resolution field "@budibase/types@0.0.0" is incompatible with requested version "@budibase/types@2.7.36-alpha.9"
success Already up-to-date.
$ husky install
husky - Git hooks installed
$ yarn nx run-many -t=build
$ /root/budibase/node_modules/.bin/nx run-many -t=build

    βœ”  nx run @budibase/string-templates:build  [local cache]
    βœ”  nx run @budibase/types:build  [local cache]
    βœ”  nx run @budibase/bbui:build  [local cache]
    βœ”  nx run @budibase/shared-core:build  [local cache]
    βœ”  nx run @budibase/server:build  [local cache]
    βœ”  nx run @budibase/client:build  [local cache]
    βœ”  nx run @budibase/worker:build  [local cache]
    βœ”  nx run @budibase/backend-core:build  [local cache]
    βœ”  nx run @budibase/builder:build  [local cache]
    βœ”  nx run @budibase/cli:build  [local cache]

4:20:32 PM - Starting compilation in watch mode...
@budibase/types: [0] 
@budibase/types: [1] 4:20:32 PM - Starting compilation in watch mode...
@budibase/types: [1] 
@budibase/shared-core: [0] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] 
@budibase/shared-core: [0] 4:20:40 PM - Found 3 errors. Watching for file changes.
@budibase/shared-core: [1] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] 
@budibase/shared-core: [1] 4:20:41 PM - Found 3 errors. Watching for file changes.

The only warning that's somehow related to the problem is:

warning Resolution field "@budibase/types@0.0.0" is incompatible with requested version "@budibase/types@2.7.36-alpha.9"

Same problem on my Mac OSX laptop.

I've tried a plenty of combinations, reinstalled OS (Ubuntu/Debian/CentOS), nothing helps.

mike12345567 commented 1 year ago

Hi @mike12345567 I believe those errors should be fine - you should be able to connect on port 10000 assuming all of the docker services started as expected (this can take a while as the first time it needs to fetch images).

jolice commented 1 year ago

Hi @mike12345567, I've the following images:

root@597169:~# docker image ls
REPOSITORY                                 TAG       IMAGE ID       CREATED         SIZE
minio/minio                                latest    4de87d6c6dd6   7 hours ago     262MB
budibase/proxy                             latest    1643ef0d3e9f   6 days ago      187MB
budibase.docker.scarf.sh/budibase/apps     latest    f91fd5f285f4   6 days ago      3.06GB
budibase.docker.scarf.sh/budibase/worker   latest    22d76df61aad   6 days ago      1.59GB
redis                                      latest    8e69fcb59ff4   2 weeks ago     130MB
curlimages/curl                            latest    4c2629951caa   2 weeks ago     22.7MB
containrrr/watchtower                      latest    f847e1adb570   5 months ago    14.6MB
ibmcom/couchdb3                            latest    b53d45e6ef2b   16 months ago   563MB

After running yarn dev, I see the following output:

5:00:11 PM - Starting compilation in watch mode...
@budibase/types: [0] 
@budibase/types: [1] 5:00:11 PM - Starting compilation in watch mode...
@budibase/types: [1] 
@budibase/shared-core: [0] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [0] 
@budibase/shared-core: [0] 5:00:21 PM - Found 3 errors. Watching for file changes.
@budibase/shared-core: [1] src/filters.ts(1,64): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/helpers.ts(1,22): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] src/helpers/integrations.ts(1,40): error TS2307: Cannot find module '@budibase/types' or its corresponding type declarations.
@budibase/shared-core: [1] 
@budibase/shared-core: [1] 5:00:21 PM - Found 3 errors. Watching for file changes.
@budibase/types: [1] 
@budibase/types: [1] 5:00:31 PM - Found 0 errors. Watching for file changes.
@budibase/types: [0] 
@budibase/types: [0] 5:00:31 PM - Found 0 errors. Watching for file changes.
@budibase/string-templates: rollup v2.79.1
@budibase/string-templates: bundles src/index.mjs β†’ dist/bundle.mjs...
@budibase/string-templates: created dist/bundle.mjs in 19.2s
@budibase/client: created dist/budibase-client.js in 1m 40.1s

And that's it.

Should I wait more or something is more? Maybe I need to start some containers?

mike12345567 commented 1 year ago

@jolice - are you running an up to date version of off of develop? Also you should not have the app and worker services running - that looks like you're running a self hosted docker-compose version of Budibase on the same system you're trying to run the development stack - this is likely to have a port clash. The command yarn dev should start the docker containers needed if you are up to date and everything is working correctly.