Skip to content

fix(pfs0): add .js extensions to relative imports for Node ESM#42

Merged
TooTallNate merged 1 commit into
mainfrom
fix/pfs0-esm-extensions
Jun 26, 2026
Merged

fix(pfs0): add .js extensions to relative imports for Node ESM#42
TooTallNate merged 1 commit into
mainfrom
fix/pfs0-esm-extensions

Conversation

@TooTallNate

Copy link
Copy Markdown
Owner

Summary

  • @tootallnate/pfs0 is "type": "module", but its emitted dist/index.js imported ./types without a .js extension. Node's ESM loader requires explicit extensions, so importing the published package throws ERR_MODULE_NOT_FOUND.
  • Add explicit .js extensions to the relative imports in src/index.ts so the emitted dist resolves cleanly under Node ESM.

Why

Hit while consuming @tootallnate/pfs0 from a plain Node script (sys-autopilot's NSZ installer). ncz/zstd-wasm are unaffected because they have no relative imports; pfs0 is the only package importing a sibling module.

Verification

  • node -e "import('@tootallnate/pfs0')" now resolves (decode/encode exported) instead of throwing.
  • Changeset included (patch).

The package is "type": "module" but tsc (moduleResolution: Bundler) emitted
extensionless `import './types'`, which Node's ESM loader rejects with
ERR_MODULE_NOT_FOUND. Add explicit .js extensions to the source imports so
the published dist resolves cleanly under Node.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nro-editor Ready Ready Preview, Comment Jun 26, 2026 8:51am
nsp-forwarder Ready Ready Preview, Comment Jun 26, 2026 8:51am
nx-archive Ready Ready Preview, Comment Jun 26, 2026 8:51am
rom-id Ready Ready Preview, Comment Jun 26, 2026 8:51am

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fc0b041

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tootallnate/pfs0 Patch
nx-archive Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@TooTallNate TooTallNate merged commit 6eb0d6a into main Jun 26, 2026
7 checks passed
@TooTallNate TooTallNate deleted the fix/pfs0-esm-extensions branch June 26, 2026 08:52
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.

1 participant