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

Uncaught Error: Cannot find module 'form-data' on esm imports >= 1.0.23 #346

Open
brian6932 opened this issue Jul 2, 2024 · 0 comments
Open
Assignees
Labels
triage This ticket will be looked at shortly

Comments

@brian6932
Copy link

brian6932 commented Jul 2, 2024

Description

🤷

Issue Type

Bug

Operating System

Windows 10, Linux

Node Version

Other

Golang Version

Other

Relevant Log Output

❯ go version
go version go1.22.4 windows/amd64

❯ node --version
v22.3.0

❯ cd (mkdir test); pnpm init; pnpm i cycletls
Wrote to ~\test\package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "type": "module"
}
Packages: +3
+++
Downloading [email protected]: 44.15 MB/44.15 MB, done
Progress: resolved 3, reused 1, downloaded 2, added 3, done

dependencies:
+ cycletls 1.0.26

Done in 2.1s

❯ corepack prepare pnpm@latest --activate
Preparing pnpm@latest for immediate activation...

❯ node
Welcome to Node.js v22.3.0.
Type ".help" for more information.
> await import(`cycletls`)
Uncaught Error: Cannot find module 'form-data'
Require stack:
- ~\test\node_modules\.pnpm\c[email protected]\node_modules\cycletls\dist\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
    at Module._load (node:internal/modules/cjs/loader:1038:27)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~\\test\\node_modules\\.pnpm\\[email protected]\\node_modules\\cycletls\\dist\\index.js'
  ]
}
>

❯ pnpm i [email protected]
Packages: +1 -1
+-
Downloading [email protected]: 43.95 MB/43.95 MB, done
Progress: resolved 3, reused 2, downloaded 1, added 1, done

dependencies:
- cycletls 1.0.26
+ cycletls 1.0.25 (1.0.26 is available)

Done in 3s

❯ node
Welcome to Node.js v22.3.0.
Type ".help" for more information.
> await import(`cycletls`)
Uncaught Error: Cannot find module 'form-data'
Require stack:
- ~\test\node_modules\.pnpm\c[email protected]\node_modules\cycletls\dist\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
    at Module._load (node:internal/modules/cjs/loader:1038:27)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~\\test\\node_modules\\.pnpm\\[email protected]\\node_modules\\cycletls\\dist\\index.js'
  ]
}
>

❯ pnpm i [email protected]
Packages: +1 -1
+-
Downloading [email protected]: 42.99 MB/42.99 MB, done
Progress: resolved 3, reused 2, downloaded 1, added 1, done

dependencies:
- cycletls 1.0.25
+ cycletls 1.0.24 (1.0.26 is available)

Done in 1.6s

❯ node
Welcome to Node.js v22.3.0.
Type ".help" for more information.
> await import(`cycletls`)
Uncaught Error: Cannot find module 'form-data'
Require stack:
- ~\test\node_modules\.pnpm\c[email protected]\node_modules\cycletls\dist\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
    at Module._load (node:internal/modules/cjs/loader:1038:27)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~\\test\\node_modules\\.pnpm\\[email protected]\\node_modules\\cycletls\\dist\\index.js'
  ]
}
>

❯ pnpm i [email protected]
Packages: +1 -1
+-
Downloading [email protected]: 43.00 MB/43.00 MB, done
Progress: resolved 3, reused 2, downloaded 1, added 1, done

dependencies:
- cycletls 1.0.24
+ cycletls 1.0.23 (1.0.26 is available)

Done in 3.1s

❯ node
Welcome to Node.js v22.3.0.
Type ".help" for more information.
> await import(`cycletls`)
Uncaught Error: Cannot find module 'form-data'
Require stack:
- ~\test\node_modules\.pnpm\c[email protected]\node_modules\cycletls\dist\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
    at Module._load (node:internal/modules/cjs/loader:1038:27)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~\\test\\node_modules\\.pnpm\\[email protected]\\node_modules\\cycletls\\dist\\index.js'
  ]
}
>

❯ pnpm i [email protected]
Packages: +1 -1
+-
Progress: resolved 3, reused 3, downloaded 0, added 1, done

dependencies:
- cycletls 1.0.23
+ cycletls 1.0.22 (1.0.26 is available)

Done in 769ms

❯ node
Welcome to Node.js v22.3.0.
Type ".help" for more information.
> await import(`cycletls`)
[Module: null prototype] {
  __esModule: true,
  default: <ref *1> [AsyncFunction: initCycleTLS] {
    default: [Circular *1],
    __esModule: true
  }
}
@brian6932 brian6932 added the triage This ticket will be looked at shortly label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage This ticket will be looked at shortly
Projects
None yet
Development

No branches or pull requests

2 participants