-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 support is broken #2623
Comments
You are using esm, so this is a duplicate of gulpjs/rechoir#43 - it requires an insane amount of work that we probably won't get to for awhile. You can switch back to CJS. |
I don't have generic advice, sorry. Would have to take it case-by-case and I don't have the bandwidth right now. |
Basically I'm asking, is it possible to use both ESM and Common JS in the same project? ESM gets used by some stuff while Gulp uses Common JS. |
I've asked on Stack Overflow. https://stackoverflow.com/q/68899837/1611058 I hope it's possible... |
Yes, you need to remove the |
I've investigated the issue a bit more. This is an issue with ts-node, not Gulp. It is highly related to this issue: I created a reduced test case and was able to determine that something in the tsconfig file causes the error in ts-node. When I added a tsconfig file to the project, it caused the error to happen. Not an issue for Gulp maintainers but still an issue in general since tsconfig files are important. |
This fixed it! 😃 TypeStrong/ts-node#922 (comment) In tsconfig.json you need the following: {
"compilerOptions": {
"module": "commonjs",
}
} |
Sorry, I thought this was commonly known. I actually think this comment is more likely to be of a benefit in a vite app: TypeStrong/ts-node#922 (comment) (you can override compiler options specifically only for ts-node) |
What were you expecting to happen?
When I follow the steps outlined in this stack-overflow post, it should allow us to write our gulp files in pure Typescript:
https://stackoverflow.com/a/49849088/1611058
These were steps that used to work back in 2020 but don't work anymore.
What actually happened?
As sydd's comment says:
Please give us a sample of your gulpfile
Terminal output / screenshots
Please provide the following information:
node -v
): v12.18.2npm -v
): 6.14.5gulp -v
): CLI version: 2.3.0; Local version: 4.0.2The text was updated successfully, but these errors were encountered: