Skip to content

Fix error messages when importing .keystone/config.js#9359

Merged
dcousens merged 5 commits into
keystonejs:mainfrom
marekryb:import_error
Oct 15, 2024
Merged

Fix error messages when importing .keystone/config.js#9359
dcousens merged 5 commits into
keystonejs:mainfrom
marekryb:import_error

Conversation

@marekryb

Copy link
Copy Markdown
Contributor

Fixes #9358

I brought back fs.stat that was removed in this commit.

Now error message is meaningful:

(base) exar@exar:~/os/keystone/examples/omit$ pnpm build

> @keystone-6/example-omit@ build /home/exar/os/keystone/examples/omit
> keystone build

🚨 importing built keystone config failed
Error: Cannot find module 'non-existing-module'
Require stack:
- /home/exar/os/keystone/examples/omit/.keystone/config.js
- /home/exar/os/keystone/packages/core/src/scripts/utils.ts
- /home/exar/os/keystone/packages/core/src/scripts/cli.ts

@codesandbox-ci

codesandbox-ci Bot commented Oct 10, 2024

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f7ae038:

Sandbox Source
@keystone-6/sandbox Configuration

@dcousens dcousens changed the title Improve error message when importing inaccessible module Fix error messages when importing .keystone/config.js Oct 15, 2024
@dcousens dcousens merged commit 70eaf68 into keystonejs:main Oct 15, 2024
@dcousens

Copy link
Copy Markdown
Member

Thanks @marekryb 💛

@dcousens dcousens mentioned this pull request Nov 5, 2024
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

Successfully merging this pull request may close these issues.

Cryptic error message for unrelated MODULE_NOT_FOUND error

2 participants