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

Error TS1203: Export assignment cannot be used [for ESM] #2983

Closed
nalply opened this issue Jun 26, 2023 · 1 comment
Closed

Error TS1203: Export assignment cannot be used [for ESM] #2983

nalply opened this issue Jun 26, 2023 · 1 comment

Comments

@nalply
Copy link

nalply commented Jun 26, 2023

Error summary
https://github.com/josdejong/mathjs/blob/develop/types/index.d.ts#L5 has an export assignment (export = math) but this seems not to be allowed for ECMAScript modules.

To Reproduce
Probably I am doing something shady, but I am trying to use mathjs for the browser without bundling. I symlinked dist/math.js to m.js and types/index.d.ts to m.d.ts in my ts source directory. I tried many other things to avoid bundling during development but kept failing, and I thought, perhaps I use the pre-bundled dist/math.js instead, but this also fails already when compiling TS.

I am willing to edit types/index.d.ts to fix this problem but need to understand a little better how mathjs is structured. For example, why export assignment? And how is MathJsStatic related to the default export math?

@josdejong
Copy link
Owner

Thanks for your input Danial. I think this is a duplicate of #2919, please continue the discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants