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
version v10.2.1 breaks CJS #36
Comments
@boneskull thanks for the report. How is this a valid usage of the project? Why would you expect to |
err, that's just the easiest way to reproduce. use |
You mean this? It works on my machine, so please provide concrete steps to reproduce: ~/camunda/projects/bpmn.io/.other/foo
> npm install didi
up to date, audited 3 packages in 512ms
found 0 vulnerabilities
~/camunda/projects/bpmn.io/.other/foo
> npm
~/camunda/projects/bpmn.io/.other/foo
> cat package.json
{
"dependencies": {
"didi": "^10.2.1"
}
}
~/camunda/projects/bpmn.io/.other/foo
> node -e "console.log(require('didi'))"
{
Injector: [Function: Injector],
annotate: [Function: annotate],
parseAnnotations: [Function: parseAnnotations]
}
~/camunda/projects/bpmn.io/.other/foo
> node --version
v20.11.1 |
Yeah, this is weird. You're right--that works. I don't understand why
It appears that might be fixable as of TS v5.3 via import attributes (alas I am still on v5.2), but it is also fixable by the lib author using something like tshy. I am not sure the levers |
That said, if you put {
"main": "./dist/index.cjs"
} Not sure your reasons for removing it. |
@boneskull I've seen a bunch of bundlers having issues with I still do not understand under which circumstances you get typescript errors. You should not get them in my tests. But if "main": "..." fixes the situation for you (and it was in fact a breaking change to remove it), please provide me a setup I can reproduce this with and I'm happy to restore the past (if it does not break the future). |
Consider to move your module resolution strategy in typescript to |
I found another case where removing |
Yeah, it breaks w/ older versions of The resolution strategy is using NodeNext, but it doesn't help with the TS errors. It's just an |
Anyway, please let me know if you want to get to the bottom of it, and I can create a minimal repo to reproduce. |
Describe the Bug
After 3ea4ec5, the package is not resolvable via CJS.
Steps to Reproduce
node -e "require('.')"
from project rootExpected Behavior
The command above should exit with a non-zero exit code.
Environment
The text was updated successfully, but these errors were encountered: