Skip to content

Conversation

MTroian94
Copy link
Contributor

Merge request about this issue #130

@MTroian94
Copy link
Contributor Author

@TheSGJ do you have any update?

@TheSGJ TheSGJ added the bug Something isn't working label Aug 2, 2025
@TheSGJ TheSGJ added enhancement New feature or request and removed bug Something isn't working labels Aug 28, 2025
@marcoreni
Copy link

Hey @TheSGJ do you have an estimated timeline for merging this? It doesn't seem a distructive change to me

@TheSGJ TheSGJ requested review from TheSGJ and Copilot September 8, 2025 13:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds ESM (ECMAScript Module) build output alongside the existing CommonJS format to improve module compatibility for modern JavaScript environments. The changes enable dual-format publishing to support both import and require syntax.

Key changes:

  • Adds ESM format to the build configuration
  • Updates package.json exports to support both ESM and CommonJS formats
  • Adds explicit module entry point for ESM consumers

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tsup.config.ts Adds ESM format to build output alongside existing CJS
package.json Updates exports map to support dual module formats and adds module field

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@TheSGJ
Copy link
Owner

TheSGJ commented Sep 8, 2025

@TheSGJ do you have any update?

Hey, so sorry for the delayed reply. This code looks good for implementing ESM support.

I will now merge these changes.

@TheSGJ TheSGJ merged commit d9c92ea into TheSGJ:master Sep 8, 2025
3 checks passed
@TheSGJ
Copy link
Owner

TheSGJ commented Sep 9, 2025

[Error: Cannot find module '.../node_modules/next/router' imported from .../node_modules/nextjs-toploader/dist/pages.mjs
Did you mean to import "next/router.js"?] {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///.../node_modules/next/router'
}

Seems to be a problem with the ESM export.

Originally posted by @Daniel3711997 in #138

I will revert this PR as it seems to be causing issues with ESM export support. Will look into this again later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants