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

ESM module files in the published package should have .mjs file extension #1143

Closed
sequba opened this issue Jan 13, 2023 · 4 comments
Closed
Assignees
Labels
Breaking Change Will need a major release Bug Something isn't working Impact: Medium Tech Debt

Comments

@sequba
Copy link
Contributor

sequba commented Jan 13, 2023

Description

Publint reports for all files in /es/ directory:

/es/${filename}.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /es/${filename}.mjs

We should change it to comply with the standard.

Warning: this change might be considered breaking because it will break the code that uses filenames with extensions in the import statements.

HOT team did a similar task in handsontable/handsontable#7403 & https://github.com/handsontable/handsontable/pull/8875/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

Links

@sequba sequba added Bug Something isn't working Breaking Change Will need a major release Impact: Medium labels Jan 13, 2023
@sequba sequba self-assigned this Jan 13, 2023
@sedghi
Copy link

sedghi commented Apr 17, 2023

Having the same issue, my library has /cjs, /umd, and /esm and here is my package json, and getting the same error

"main": "dist/umd/index.js",
"module": "src/index.ts",
"exports": {
  ".": {
    "import": "./dist/esm/index.js",
    "require": "./dist/cjs/index.js"
  },
  "./package.json": "./package.json"
},

@AMBudnik
Copy link
Contributor

Thank you for the feedback @sedghi

I will notify you as soon as we fix this issue.

@sequba
Copy link
Contributor Author

sequba commented Apr 18, 2023

@sedghi Ok, we'll increase the priority of this task. Is it a blocker for you? Were you able to make HyperFormula work by adjusting the configuration?

@sequba
Copy link
Contributor Author

sequba commented Apr 12, 2024

Will be done in scope of #1344

@sequba sequba closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Will need a major release Bug Something isn't working Impact: Medium Tech Debt
Projects
None yet
Development

No branches or pull requests

3 participants