Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The stores could not be found #8562

Closed
3 tasks done
danieljwestman opened this issue Oct 5, 2021 · 16 comments
Closed
3 tasks done

The stores could not be found #8562

danieljwestman opened this issue Oct 5, 2021 · 16 comments

Comments

@danieljwestman
Copy link
Contributor

danieljwestman commented Oct 5, 2021

Preflight Checklist

Describe the Bug

Building a fresh Directus clone from main repo works as it should. But when starting up some routes fails.

Skärmavbild 2021-10-05 kl  16 24 43

Some of the failing routes are /users, /files and /collections/[collection name].

The error seems to be that the stores can't be found in the shared package.

Line 6 in /packages/shared/src/composables/use-system.ts

Skärmavbild 2021-10-05 kl  16 30 47

stores beeing undefined.

To Reproduce

Download a fresh clone of the main repo.

npm install

npx directus start

(npm run dev is still working)

What version of Directus are you using?

v.9.0.0-rc.95

What version of Node.js are you using?

16

What database are you using?

PG 13

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying Directus?

running locally / main repo clone

@rijkvanzanten
Copy link
Member

Make sure to run npm run build as well after you've ran npm install. I believe the issue here is that your dist from @directus/shared is outdated

@danieljwestman
Copy link
Contributor Author

Yes, forgot to write that.

npm run build is indeed done... before running

@rijkvanzanten
Copy link
Member

Is your local bin for directus the local build of the api, or could it be it's an (older) global install? I tend to use npm run dev -w directus to run the api in dev mode, or use npm run cli <command> to run the CLI commands straight from source 🤔

@danieljwestman
Copy link
Contributor Author

danieljwestman commented Oct 5, 2021

directus bin is a symlink to the src (api build).. 🤯

This has been working just fine before...

@rijkvanzanten
Copy link
Member

Was that first npm install in the root from a recent version of node / npm? I know they were having some trouble with the workspaces package resolution, so that might be another culprit 🤔 npm/cli#3637

@danieljwestman
Copy link
Contributor Author

Hm, okay. I'm currently running node 16, I'll give it try to downgrade

@danieljwestman
Copy link
Contributor Author

danieljwestman commented Oct 5, 2021

Now tried with node 16, 14 and 12, and npm 7 and 6.

Same problem... 😣

Skärmavbild 2021-10-05 kl  18 47 06

@rijkvanzanten
Copy link
Member

@nickrum any ideas?

@danieljwestman
Copy link
Contributor Author

(This is the same problem that lately occurs when running on DigitalOcean App Platform, as mentioned in Discord)

@nickrum
Copy link
Member

nickrum commented Oct 5, 2021

Very odd.. @danieljwestman could you check if there is a vue folder inside node_modules/, app/node_modules/ and packages/shared/node_modules/?

@danieljwestman
Copy link
Contributor Author

danieljwestman commented Oct 5, 2021

✅ /node_modules/vue
✅ /app/node_modules/vue
✅ /packages/shared/node_modules/vue

The app is working for some routes, but not /users, /files and /collections/[collection name], and some other.

@rijkvanzanten
Copy link
Member

@danieljwestman What's the output of npm list vue? Wondering if they're using a different context

@nickrum
Copy link
Member

nickrum commented Oct 5, 2021

That's not a good sign... Vue should only be installed inside the root node_modules/, otherwise app and shared will use different versions and the inject()-call you showed above won't work.

I'm not sure what is causing this, though. When you were trying other npm versions, did you clean the repo beforehand? (Using npx lerna clean and deleting the root node_modules/)

@danieljwestman
Copy link
Contributor Author

danieljwestman commented Oct 5, 2021

@rijkvanzanten What's the output of npm list vue? Wondering if they're using a different context

├─┬ @directus/app@9.0.0-rc.95 -> ./app
│ ├─┬ @directus/shared@9.0.0-rc.95 -> ./packages/shared
│ │ └── vue@3.2.19 deduped
│ ├─┬ @tinymce/tinymce-vue@4.0.4
│ │ └── vue@3.2.19 deduped
│ ├─┬ @vue/cli-plugin-babel@4.5.13
│ │ └─┬ @vue/babel-preset-app@4.5.13
│ │   └── vue@3.2.19 deduped
│ ├─┬ pinia@2.0.0-rc.11
│ │ ├─┬ vue-demi@0.11.4
│ │ │ └── vue@3.2.19 deduped
│ │ └── vue@3.2.19 deduped
│ ├─┬ vue-i18n@9.1.8
│ │ └── vue@3.2.19 deduped
│ ├─┬ vue-router@4.0.11
│ │ └── vue@3.2.19 deduped
│ ├─┬ vue@3.2.19
│ │ └─┬ @vue/server-renderer@3.2.19
│ │   └── vue@3.2.19 deduped
│ └─┬ vuedraggable@4.1.0
│   └── vue@3.2.19 deduped
├─┬ @directus/docs@9.0.0-rc.95 -> ./docs
│ └─┬ vuepress@1.8.2
│   └─┬ @vuepress/core@1.8.2
│     ├─┬ @vue/babel-preset-app@4.5.13
│     │ └── vue@2.6.14 deduped
│     └── vue@2.6.14
├─┬ @directus/extensions-sdk@9.0.0-rc.95 -> ./packages/extensions-sdk
│ └─┬ @directus/shared@9.0.0-rc.95 -> ./packages/shared
│   └── vue@3.2.19 deduped
├─┬ @directus/shared@9.0.0-rc.95 -> ./packages/shared
│ ├─┬ vue-i18n@9.1.8
│ │ └── vue@3.2.19 deduped
│ ├─┬ vue-router@4.0.11
│ │ └── vue@3.2.19 deduped
│ └─┬ vue@3.2.19
│   └─┬ @vue/server-renderer@3.2.19
│     └── vue@3.2.19 deduped
├─┬ @tinymce/tinymce-vue@4.0.4 extraneous
│ └── vue@3.2.19 deduped
├─┬ @vue/babel-preset-app@4.5.13 extraneous
│ └── vue@3.2.19 deduped
├─┬ @vue/server-renderer@3.2.19 extraneous
│ └── vue@3.2.19 deduped
├─┬ @vuepress/core@1.8.2 extraneous
│ └── vue@2.6.14 extraneous
├─┬ create-directus-extension@9.0.0-rc.95 -> ./packages/create-directus-extension
│ └─┬ @directus/shared@9.0.0-rc.95 -> ./packages/shared
│   └── vue@3.2.19 deduped
├─┬ directus@9.0.0-rc.95 -> ./api
│ ├─┬ @directus/app@9.0.0-rc.95 -> ./app
│ │ └── vue@3.2.19 deduped
│ └─┬ @directus/shared@9.0.0-rc.95 -> ./packages/shared
│   └── vue@3.2.19 deduped
├─┬ pinia@2.0.0-rc.11 extraneous
│ ├─┬ vue-demi@0.11.4 extraneous
│ │ └── vue@3.2.19 deduped
│ └── vue@3.2.19 deduped
├─┬ vue-i18n@9.1.8 extraneous
│ └── vue@3.2.19 deduped
├─┬ vue-router@4.0.11 extraneous
│ └── vue@3.2.19 deduped
├── vue@3.2.19 extraneous
└─┬ vuedraggable@4.1.0 extraneous
  └── vue@3.2.19 deduped

@danieljwestman
Copy link
Contributor Author

@nickrum I'm not sure what is causing this, though. When you were trying other npm versions, did you clean the repo beforehand? (Using npx lerna clean and deleting the root node_modules)

I cleaned up with npx lerna clean and removed the root node_modules. Then reinstalled everything and built the whole thing over and over again. The problem with useStores won't go away... The stores cannot be injected in the shared package - it's undefined

@danieljwestman
Copy link
Contributor Author

danieljwestman commented Oct 5, 2021

Update: if I manually remove the vue package from all node_modules except in the root it's all good again... 😅 But I have to do this every time I've updated 🤔

@directus directus locked and limited conversation to collaborators Oct 6, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants