question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom-field-view example not working, can't resolve

See original GitHub issue

To Repro

With NodeJS v16.13.2

  1. Checkout Keystone source (29c6a45fd5fef8ea27f5d051b4fb5d660492aad5)
  2. cd examples\custom-field-view
  3. npm install
  4. npm run dev

Log

✨ Starting Keystone
⭐️ Dev Server Starting on http://localhost:3000
⭐️ GraphQL API Starting on http://localhost:3000/api/graphql
✨ Generating GraphQL and Prisma schemas
✨ sqlite database "keystone-example.db" created at file:./keystone-example.db
✨ Your database is now in sync with your schema. Done in 815ms
✨ Connecting to the database
✨ Creating server
✅ GraphQL API ready
✨ Generating Admin UI code
✨ Preparing Admin UI app
event - compiled client and server successfully in 7.4s (1307 modules)
✅ Admin UI ready
wait  - compiling /api/__keystone_api_build...
event - compiled client and server successfully in 436 ms (1322 modules)
wait  - compiling...
error - ./pages/_app.js:10:0
Module not found: Can't resolve '../../fields/related-links/components'
   8 | import * as view5 from "../../../node_modules/@keystone-6/core/fields/types/timestamp/views";
   9 | import * as view6 from "../../../node_modules/@keystone-6/core/fields/types/json/views";
> 10 | import * as view7 from "../../fields/related-links/components";
  11 | 
  12 | var adminConfig = {};
  13 | 

https://nextjs.org/docs/messages/module-not-found

First noticed this in my own app, can reproduce in the core example.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
yoiangcommented, Feb 1, 2022

@xenobytezero , your ask to replace require.resolve with path.join(process.cwd(), ...) did resolve the issue for me with a custom component within my repo I made based off of the example, thank you!

1reaction
JMLX42commented, Feb 13, 2022

So the qustion back to you guys: Did you devlop your KeystoneJS project on Windows, Linux or MacOS?

I’m using Ubuntu 21.10 and require.resolve does not work but computing the path (ex: path.join(process.cwd(), ...)) works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom fieldviews overview - CS Professional Suite
Some fieldviews, called custom fieldviews, can be customized and can be linked or not linked. Note: Custom fieldview items are available to all...
Read more >
Climate FieldView 201
FieldView ™ enables you to collect planting, harvest and spraying application data. Once your data is collected, you can then analyze it to...
Read more >
Custom Virtual UI rendering #6114 - keystonejs/keystone
Simple Example: Consider a virtual field for product "discount". Returning a ratio ( .20 ) makes sense for the API, but in the...
Read more >
Field missing in odata feed - Visual Studio Feedback
There is a custom field that I'm attempting to return in the oData query but it ... IS returned vs. one that is...
Read more >
Project import fails due to missing custom field options in Jira ...
Problem. Project Import is blocked as JIRA can't find custom field ... In this example, we use a custom field with the name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found