Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'fp-ts/lib/Either' #9113

Open
ttbarnes opened this issue Apr 24, 2024 · 6 comments
Open

Cannot find module 'fp-ts/lib/Either' #9113

ttbarnes opened this issue Apr 24, 2024 · 6 comments
Labels
🐛 bug Unresolved bug

Comments

@ttbarnes
Copy link
Contributor

ttbarnes commented Apr 24, 2024

Hiya, i've bumped the following packages to the latest versions, with node version 21.6.2, NPM version 10.2.4:

"@keystone-6/auth": "^8.0.0",
"@keystone-6/core": "^6.0.0",
"@keystone-6/fields-document": "^9.0.0",

When running npm run dev, which has the following:

"keystone dev --no-ui",

I get the following error, Keystone cannot start:

> keystone dev  --no-ui

 Starting Keystone
(node:87386) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: Cannot find module 'fp-ts/lib/Either'
Require stack:
- /Users/tonyb/project/src/api/node_modules/io-ts/lib/index.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/fields-document/dist/validation-d47c8b80.cjs.dev.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/fields-document/dist/keystone-6-fields-document.cjs.dev.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/fields-document/dist/keystone-6-fields-document.cjs.js
- /Users/tonyb/project/src/api/.keystone/config.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/core/dist/createSystem-b211ce31.cjs.dev.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/core/scripts/cli/dist/keystone-6-core-scripts-cli.cjs.dev.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.js
- /Users/tonyb/project/src/api/node_modules/@keystone-6/core/bin/cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)
    at /Users/tonyb/project/src/api/node_modules/next/dist/server/require-hook.js:54:36
    at Module._load (node:internal/modules/cjs/loader:990:27)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at mod.require (/Users/tonyb/project/src/api/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/tonyb/project/src/api/node_modules/io-ts/lib/index.js:43:16)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/tonyb/project/src/api/node_modules/io-ts/lib/index.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/fields-document/dist/validation-d47c8b80.cjs.dev.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/fields-document/dist/keystone-6-fields-document.cjs.dev.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/fields-document/dist/keystone-6-fields-document.cjs.js',
    '/Users/tonyb/project/src/api/.keystone/config.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/core/dist/createSystem-b211ce31.cjs.dev.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/core/scripts/cli/dist/keystone-6-core-scripts-cli.cjs.dev.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.js',
    '/Users/tonyb/project/src/api/node_modules/@keystone-6/core/bin/cli.js'
  ]
}

Seems to be an issue relating to io-ts.

How can this be resolved please?

@ttbarnes ttbarnes changed the title Cannot run keystone with the latest release Unable to run keystone with the latest release Apr 24, 2024
@ttbarnes ttbarnes changed the title Unable to run keystone with the latest release Unable to run Keystone with the latest release Apr 24, 2024
@dcousens
Copy link
Member

dcousens commented Apr 24, 2024

Are you using io-ts or fp-ts in your project?

@ttbarnes
Copy link
Contributor Author

Are you using io-ts or fp-ts in your project?

Thanks for the quick response @dcousens - not specifically, seem to be dependencies within Keystone:

npm ls io-ts
api@1.0.0
└─┬ @keystone-6/fields-document@8.0.2
  ├─┬ io-ts-excess@1.0.1
   └── io-ts@2.2.21 deduped
  └── io-ts@2.2.21


npm ls fp-ts
api@1.0.0
├─┬ @keystone-6/core@5.8.0
 ├─┬ @prisma/internals@4.16.2
  └── fp-ts@2.16.0
 └─┬ @prisma/migrate@4.16.2
   └── fp-ts@2.16.0 deduped
└─┬ @keystone-6/fields-document@8.0.2
  ├─┬ io-ts-excess@1.0.1
   └── fp-ts@2.16.0 deduped
  └─┬ io-ts@2.2.21
    └── fp-ts@2.16.0 deduped

@vishalkumar-activelabs
Copy link

image

I am facing similar issue.

@ttbarnes Found any solutions?

@ttbarnes
Copy link
Contributor Author

image

I am facing similar issue.

@ttbarnes Found any solutions?

Unfortunately not 😢

@galloppinggryphon
Copy link

Further to @ttbarnes, previous release of @keystone-6/fields-document (8.0.2, if I'm not mistaken) complained about missing correct versions of fp-ts:

// yarn add @keystone-6/core@5.8.0 @keystone-6/auth@7.0.3 @keystone-6/fields-document@8.0.2
warning "@keystone-6/fields-document > io-ts@2.2.21" has unmet peer dependency "fp-ts@^2.5.0".
warning "@keystone-6/fields-document > io-ts-excess@1.0.1" has unmet peer dependency "fp-ts@^2.0.0".

Looking forward to a fix.

@dcousens
Copy link
Member

dcousens commented Apr 26, 2024

I think potentially we need to add fp-ts as a peer dependency to the @keystone-6/fields-document package - pull requests accepted!

@dcousens dcousens added the 🐛 bug Unresolved bug label Apr 26, 2024
@dcousens dcousens changed the title Unable to run Keystone with the latest release Cannot find module 'fp-ts/lib/Either' Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unresolved bug
Projects
None yet
Development

No branches or pull requests

4 participants