n8n - 💡(How to fix) Fix @n8n/workflow-sdk scripts/generate-types export points to missing source file

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

@n8n/[email protected] exports ./scripts/generate-types to ./src/generate-types/generate-types.ts, but that source file is not included in the published npm package.

The package does include the built file at dist/generate-types/generate-types.js.

Root Cause

The exported subpath import fails with ERR_MODULE_NOT_FOUND because src/generate-types/generate-types.ts is absent from the package.

Code Example

tmp="$(mktemp -d)"
cd "$tmp"
npm init -y >/dev/null
npm install --ignore-scripts @n8n/workflow-sdk@0.18.1

node - <<'NODE'
const fs = require('node:fs');
const path = require('node:path');
const root = path.join(process.cwd(), 'node_modules/@n8n/workflow-sdk');
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));

console.log(pkg.exports['./scripts/generate-types']);
for (const file of [
  'src/generate-types/generate-types.ts',
  'dist/generate-types/generate-types.js',
  'dist/index.js',
]) {
  console.log(file, fs.existsSync(path.join(root, file)));
}
NODE

node -e "import('@n8n/workflow-sdk/scripts/generate-types')"
RAW_BUFFERClick to expand / collapse

Summary

@n8n/[email protected] exports ./scripts/generate-types to ./src/generate-types/generate-types.ts, but that source file is not included in the published npm package.

The package does include the built file at dist/generate-types/generate-types.js.

Reproduction

tmp="$(mktemp -d)"
cd "$tmp"
npm init -y >/dev/null
npm install --ignore-scripts @n8n/[email protected]

node - <<'NODE'
const fs = require('node:fs');
const path = require('node:path');
const root = path.join(process.cwd(), 'node_modules/@n8n/workflow-sdk');
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));

console.log(pkg.exports['./scripts/generate-types']);
for (const file of [
  'src/generate-types/generate-types.ts',
  'dist/generate-types/generate-types.js',
  'dist/index.js',
]) {
  console.log(file, fs.existsSync(path.join(root, file)));
}
NODE

node -e "import('@n8n/workflow-sdk/scripts/generate-types')"

Actual behavior

The exported subpath import fails with ERR_MODULE_NOT_FOUND because src/generate-types/generate-types.ts is absent from the package.

Expected behavior

The ./scripts/generate-types export should point to an included file, likely ./dist/generate-types/generate-types.js, or the referenced source file should be included if that is intentional.

Environment used to reproduce: macOS, Node v24.10.0, npm 11.6.0.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The ./scripts/generate-types export should point to an included file, likely ./dist/generate-types/generate-types.js, or the referenced source file should be included if that is intentional.

Environment used to reproduce: macOS, Node v24.10.0, npm 11.6.0.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING