-
Notifications
You must be signed in to change notification settings - Fork 16
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 importing trino-client because of type mismatch #721
Comments
Sounds good .. Want to send a PR to remove that and cut a new release @nineinchnick or @ZeRego .. or will your PR land soon @regadas ? |
Ultimately we want users to be able to use the client in as many JS versions/stacks as possible. |
Yeah I was reaching this conclusion over the weekend; I'll revert the change and release it today. Regarding the draft PR, it shouldn't impact things as it only tackles eslint and jest. |
The default eslint config after update looks like this: https://github.com/trinodb/github-actions/blob/main/action-surefire-report/eslint.config.cjs |
Awesome |
Released 0.2.5 .. please confirm that you are all good now |
@mosabua, I updated my I think we need to fix the |
The trino-client configuration is inconsistent in 0.2.4, and this mismatch is causing an error.
Here's why:
type: "module"
in package.json:This tells Node.js to treat all .js files in the package as ES Modules by default. This affects how Node.js resolves and executes the files.
"module": "commonjs"
in tsconfig.json:This tells TypeScript to compile the code as CommonJS modules. The emitted files will use CommonJS syntax (e.g., require instead of import).
Why is This Problematic?
When type: "module" is set:
Node.js expects the files to use ES Module syntax (import/export).
But the compiled CommonJS code (require/module.exports) doesn't match this expectation.
This creates conflicts because Node.js cannot correctly interpret CommonJS output in a package marked as an ES Module.
Solution
I don't know why
type: "module"
was recently added to package.json but the simplest solution is to rollback this change.Note that 0.2.3 works fine but we would like to use the latest version to patch a security vulnerability in axious which is a dependency from trino-client.
The text was updated successfully, but these errors were encountered: