Skip to content
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

Customer Admin UI Logo Example is broken #8844

Open
TheMikeyRoss opened this issue Sep 30, 2023 · 8 comments
Open

Customer Admin UI Logo Example is broken #8844

TheMikeyRoss opened this issue Sep 30, 2023 · 8 comments

Comments

@TheMikeyRoss
Copy link

in the readme.md file here it seems that the code sandbox example is broken due to the following error:

✨ Starting Keystone
✘ [ERROR] Could not resolve "../example-utils"

    keystone.ts:2:30:
      2 │ import { fixPrismaPath } from '../example-utils';
        ╵                               ~~~~~~~~~~~~~~~~~~

Error: Cannot find module '/project/sandbox/.keystone/config.js'
Require stack:
- /project/sandbox/node_modules/@keystone-6/core/dist/artifacts-ad26eee3.cjs.dev.js
- /project/sandbox/node_modules/@keystone-6/core/scripts/cli/dist/keystone-6-core-scripts-cli.cjs.dev.js
- /project/sandbox/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js
- /project/sandbox/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.js
- /project/sandbox/node_modules/@keystone-6/core/bin/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at /project/sandbox/node_modules/next/dist/server/require-hook.js:110:36
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.getBuiltKeystoneConfiguration (/project/sandbox/node_modules/@keystone-6/core/dist/artifacts-ad26eee3.cjs.dev.js:365:28)
    at dev (/project/sandbox/node_modules/@keystone-6/core/scripts/cli/dist/keystone-6-core-scripts-cli.cjs.dev.js:886:42)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/project/sandbox/node_modules/@keystone-6/core/dist/artifacts-ad26eee3.cjs.dev.js',
    '/project/sandbox/node_modules/@keystone-6/core/scripts/cli/dist/keystone-6-core-scripts-cli.cjs.dev.js',
    '/project/sandbox/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js',
    '/project/sandbox/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.js',
    '/project/sandbox/node_modules/@keystone-6/core/bin/cli.js'
  ]
}
error Command failed with exit code 1.
@TheMikeyRoss
Copy link
Author

It seems the blog example is broken as well
https://githubbox.com/keystonejs/keystone/tree/main/examples/usecase-blog

@TsarPrince
Copy link

TsarPrince commented Oct 8, 2023

The "Example Project: Authentication" link here at the bottom also returns 404 (not very sure if this is related with the issue)
https://github.com/keystonejs/keystone/tree/main/examples/with-auth

@digitalrisedorset
Copy link

digitalrisedorset commented Apr 22, 2024

I have this example working on my local. However, unfortunately, I had to workaround this problem. TO get the example to work, I had 2 issues:
Both imports below were not resolved correctly

  • import type { Lists } from '.keystone/types'
  • import { fixPrismaPath } from '../example-utils'

I found example-utils in the example root folder
I found the types file in node_modules/.keystone folder

I made sure that these files were in a location that was resolved and the example ended up working.

@dcousens
Copy link
Member

@digitalrisedorset are you running the example from within the example folder? 😕

@digitalrisedorset
Copy link

@digitalrisedorset are you running the example from within the example folder? 😕

That is how I started the experiment (apologies, I am new to keystone). Since it was failing and I had no experience to troubleshoot it, I tried various situations.. Once I got it working, I realised that both these files were the culprit. I have looked at resolving the issue in the monorepo. Since I saw your comment, I thought I'd mention my findings in case someone has more ideas as to what is not right in the monorepo

@digitalrisedorset
Copy link

Hi @TheMikeyRoss I have tried again the monorepo today. To setup an example/use case, we have 2 steps: pnpm install and pnpm dev. I was doing the first step in the example folder whilst it should be run from the monorepo root folder (it is written but somehow I missed the word root).
Once pnpm install is successful at the root
pnpm dev on either subfolder from the example folder launch the example with no issue

@digitalrisedorset
Copy link

@digitalrisedorset are you running the example from within the example folder? 😕

thanks for replying, I was indeed running from the example. Now, I only run one command from the example folder and the other from the root as per the README recommendations

@dcousens
Copy link
Member

Ah yup, you need to pnpm install from the monorepo root, and then use pnpm dev inside the examples.
If the documentation wording could be improved any, please make a pull request! 💛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants