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

Missing export on commonjs #197

Closed
dmail opened this issue Oct 1, 2021 · 2 comments · Fixed by #199
Closed

Missing export on commonjs #197

dmail opened this issue Oct 1, 2021 · 2 comments · Fixed by #199
Assignees
Labels
bug Something isn't working

Comments

@dmail
Copy link
Member

dmail commented Oct 1, 2021

main.mjs:

import { answer } from './file.cjs'

console.log(answer)

file.cjs:

module.exports = require('./answer.cjs')

answer.cjs:

exports.answer = 42

Logs undefined.
There was an attempt to fix that in #196 but it seems to be on rollup side.

I will use this issue to track what's hapenning on the rollup issue and eventually find alternatives or workaround.

@dmail dmail added the bug Something isn't working label Oct 1, 2021
@dmail dmail self-assigned this Oct 1, 2021
@dmail
Copy link
Member Author

dmail commented Oct 1, 2021

Promising but only command line https://github.com/azu/commonjs-to-es-module-codemod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant