keystone icon indicating copy to clipboard operation
keystone copied to clipboard

None of the codesandbox examples work

Open JonasGruenwald opened this issue 2 years ago • 9 comments

This applies to all of the examples, when clicking the Codesandbox link it fails to build with an error. Error from this example is the following:

yarn run v1.22.19
$ keystone dev
✨ Starting Keystone
✘ [ERROR] Could not resolve "../example-utils"

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

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentationabout this command.

Codesandbox link: https://githubbox.com/keystonejs/keystone/tree/main/examples/usecase-blog

JonasGruenwald avatar Apr 07 '23 14:04 JonasGruenwald

in keystone.ts delete line 2, 11,12 in your sandbox, refresh the browser after the change

husinzz avatar Apr 28 '23 03:04 husinzz

Keystone is currently broken with latest version of next #8575

Thinkscape avatar May 24 '23 02:05 Thinkscape

@JonasGruenwald You have to copy this (https://github.com/keystonejs/keystone/blob/main/examples/example-utils.ts) file's content and create new file with the same name and put that file inside of root dir of that sandbox after that just do this,

import { fixPrismaPath } from '../example-utils';

to

import { fixPrismaPath } from './example-utils';

in keystone.ts file

kisankumavat avatar Jun 01 '23 12:06 kisankumavat

Still not fixed :(

sadakura avatar Aug 04 '23 13:08 sadakura

@sadakura unfortunately we don't know of an easy fix for this at this time - open to any suggestions :)

dcousens avatar Aug 05 '23 10:08 dcousens

@sadakura unfortunately we don't know of an easy fix for this at this time - open to any suggestions :)

sorry if I have insulted someone, no I'm not similar with these things to help, just looked up for demo :) great project anyway.

sadakura avatar Aug 05 '23 11:08 sadakura

The workaround suggested by @kisankumavat works fine btw.

I don't really care but I guess since example-utils.ts just exports a single line function it could just be added or in-lined into all the example repos?

JonasGruenwald avatar Aug 05 '23 14:08 JonasGruenwald

This isn't just the fixPrismaPath, it seems that #9112 introduced a larger issue.

Unless I manually give the deps non-workspace or catalog values, I get stuck on a select dep screen, which I can't progress past:

image

If I update the dep values, and restart, I get to the example-utils error:

image

I'm going to spend a little time looking for solutions.

kennedybaird avatar Aug 06 '24 01:08 kennedybaird

@kennedybaird indeed, the trade-off was to help make my life easier in keeping the examples up to date.

I'm happy for us to inline the fixPrismaPath code for each example, but the version updates are a pain and I'm trying to reduce the complexity of our release process.

dcousens avatar Aug 06 '24 04:08 dcousens