keystonejs / keystone

The most powerful headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
8.98k stars 1.13k forks source link

Local assets example throws an error on image upload #9106

Open jneidel opened 2 months ago

jneidel commented 2 months ago

When running the examples/assets-local with pnpm dev and try to upload an image I get:

An error occurred while resolving input fields.
  - Post.banner: require() of ES Module /home/jneidel/tmp/keystone/node_modules/.pnpm/file-type@19.0.0/node_modules/file-type/index.js from /home/jneidel/tmp/keystone/packages/core/src/lib/assets/createImagesContext.ts not supported.
Instead change the require of index.js in /home/jneidel/tmp/keystone/packages/core/src/lib/assets/createImagesContext.ts to a dynamic import() which is available in all CommonJS modules.

screenshot_24-04-20_08:59:11

node -v => v16.20.2