-
Notifications
You must be signed in to change notification settings - Fork 20
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 vs. commonjs #119
Comments
Hey, I'm aiming to support both cjs and esm. Unfortunately, I was unable to reproduce the typescript error but I checked there is indeed a problem with the cjs version. Please try with version 0.14.1 and let me know. |
Thank you. Just checked on 0.14.1 and I'm seeing the same thing. On a local fork if I remove |
Alright, I tried that - v0.14.3. Do you have the repo it's not working on available publically, or share a |
Yes. Apologies. Meant to do that initially. Here it is: {
"compilerOptions": {
"target": "es2022",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"moduleResolution": "Node16",
"exactOptionalPropertyTypes": true,
"outDir": "./dist",
"skipLibCheck": true,
"plugins": [
{
"name": "@effect/language-service"
}
]
}
} |
Confirmed working on my end on |
Aha! It is an "incorrect" conditional export setting in effect-http for the Anyway, thanks a lot for sharing the issue. I'll discuss the proper package configuration with people on the effect discord. For now, the setup should work for both esm and cjs. |
Hello! Thank you for this library.
I am receiving the following typescript error on
0.12.1
:TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("effect-http")' call instead. To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field
"type": "module"
to 'package.json'.I was not seeing this error in past versions.
Is the library no longer commonjs compatible?
The text was updated successfully, but these errors were encountered: