-
Notifications
You must be signed in to change notification settings - Fork 120
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
TypeScript Not Working When Package.json type is "module" #549
Comments
Thanks for opening this issue @Lozoute, we'll take a look and provide you an update as soon as we get one. |
Hey @Lozoute, we're still looking into this internally and trying to find the best course of action here that won't break anything for cjs users. Until then, during my testing I found that if you use |
Hello @mrashed-dev
I think it's crazy that the first thing we have on the NodeJs SDK Documentation is this:
And it doesn't even work properly. |
My only working solution for now is to do this:
|
@mrashed-dev this is still not resolved. The hack suggested by @Lozoute still works. |
Describe the bug
When installing Nylas SDK 7 to a new repo, using TypeScript 5 and type "module" in package.json, TypeScript throws the error
This expression is not constructable.
adding type: "module" into the package.json of Nylas fixes the problem but then commonjs requires do not work anymore.To Reproduce
1 Create a new repo
2 Add this package.json
3. Add this tsconfig.json
4. Add this nylas.mts file
5. npm install && npm start
Expected behavior
Well I guess we should have no error but the tsc compiler throws the error
This expression is not constructable.
SDK Version:
7.2.1
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: