keystone
keystone copied to clipboard
Adding external Keystone packages leads to looping Admin UI in production mode
Bug report
When we adding some external package to Keystone, that is built from sources, this leads to looping the Admin UI in web browser, if we built Keystone in production mode. In dev mode all works well.
To Reproduce
- Clone the fork of Keystone with little changes: https://github.com/MurzNN/keystone/tree/tracking-test1 Changes are not too large: https://github.com/MurzNN/keystone/commit/a5dab2b3449d871b84c2fb19655f04f084e1be39
git clone https://github.com/MurzNN/keystone.git -b tracking-test1 --depth=1
cd keystone
yarn
- Launch Keystone in dev mode and open the Admin UI:
cd examples/blog
yarn dev
- all will work well.
- Build Keystone in production mode, using:
cd examples/blog
NODE_ENV=production ./node_modules/.bin/keystone-next build && NODE_ENV=production ./node_modules/.bin/keystone-next start
Open the Admin UI in web browser, and see infinite loop of web page with 3-dot spinner, in console there are looping errors:
TypeError: t[n.viewsIndex] is undefined - NextJS 23
framework.ec22bb2ca455ab321977.js:1:89954
TypeError: t[n.viewsIndex] is undefined - NextJS 23
main-68de717823d32f688162.js:1:3152
- If I copy functions from external package
@keystonejs-contrib-next/list-plugins
to local files and include them locally - all becomes work well.
An interesting thing, is that if I move the examples/blog
folder outside of keystone
git folder, remove the node_modules
and do yarn
again - this issue will disappear.
And this problem is reproducible in our project already long time (even before the https://github.com/keystonejs/keystone/pull/5665 merged), so it not depends on some recent or temporary changes in Keystone.
@MurzNN are you still seeing this problem in 2023? Please re-open if you are