Skip to content

fix: use explicit .js extension in type imports for nodenext compatibility - #225

Merged
elliott-with-the-longest-name-on-github merged 1 commit into
mainfrom
fix/nodenext-imports
Oct 9, 2026
Merged

elliott-with-the-longest-name-on-github merged 1 commit into
mainfrom
fix/nodenext-imports

Conversation

@elliott-with-the-longest-name-on-github

Copy link
Copy Markdown
Contributor

closes #222

uneval.js had @import { UnevalReplacer } from './types', with no extension. That import ends up in the published .d.ts files, so it breaks anyone using module: nodenext. We never caught it because our own tsconfig used module: esnext, which happily resolves extensionless imports.

This adds the .js extension and switches our tsconfig to module: nodenext, so test:types fails on this kind of mistake from now on. Since we publish src/*.js as-is for Node to load directly, nodenext is the setting that actually matches how the code runs. It is also the strictest one, so if it passes here it works for bundler/esnext consumers too.

I checked this by building the declarations and using them from a nodenext project with skipLibCheck: false. It compiles cleanly.

@changeset-bot

changeset-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 879c6f7

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

This PR includes changesets to release 1 package
Name Type
devalue 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

@Nic-Polumeyv Nic-Polumeyv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fire

@elliott-with-the-longest-name-on-github
elliott-with-the-longest-name-on-github merged commit c411e5e into main Oct 9, 2026
5 checks passed
@elliott-with-the-longest-name-on-github
elliott-with-the-longest-name-on-github deleted the fix/nodenext-imports branch October 9, 2026 18:02
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.

Please fix import at uneval.js to be node compatible

2 participants