Skip to content

Gulp5: gulpfile.ts Not Found, gulpfile.js AOK #2834

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

Open
4 tasks done
Dulux-Oz opened this issue Apr 6, 2025 · 0 comments
Open
4 tasks done

Gulp5: gulpfile.ts Not Found, gulpfile.js AOK #2834

Dulux-Oz opened this issue Apr 6, 2025 · 0 comments

Comments

@Dulux-Oz
Copy link

Dulux-Oz commented Apr 6, 2025

Before you open this issue, please complete the following tasks:

  • use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
  • if you are looking for help from the gulp team or community, open a discussion.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • if you think there is a bug in our code, open this issue.

What were you expecting to happen?

With the following packages installed eith as Globals or DevDependencies:

  • Global
    • gulp-cli@3.0.0
  • Local
    • @types/gulp@4.0.17
    • gulp-typescript@6.0.0-alpha.1
    • gulp@5.0.0
    • ts-node@10.9.2
    • typescript@5.8.2

I expect the below gulpfile.ts/index.ts to run.

Note: Not using a specific tsconfig.json file because from the TS-Node Documentation: If no tsconfig.json is loaded from disk, ts-node will use the newest recommended defaults from [@tsconfig/bases](https://github.com/tsconfig/bases/) compatible with your node and typescript versions..

What actually happened?

The following error is produced:

duluxoz@work_box:/my_project $ > gulp
Error: Cannot find module '/my_project/gulpfile.ts'
Require stack:
- /nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/lib/shared/require-or-import.js
- /nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/lib/versioned/^5.0.0/index.js
- /nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/index.js
- /nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/bin/gulp.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1405:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
    at Function._load (node:internal/modules/cjs/loader:1215:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1491:12)
    at require (node:internal/modules/helpers:135:16)
    at requireOrImport (/nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/lib/shared/require-or-import.js:20:11)
    at execute (/nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/lib/versioned/^5.0.0/index.js:35:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/lib/shared/require-or-import.js',
    '/nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/lib/versioned/^5.0.0/index.js',
    '/nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/index.js',
    '/nvm/versions/node/v23.8.0/lib/node_modules/gulp-cli/bin/gulp.js'
  ]
}

Please give us a sample of your gulpfile

"use strict";
import gulp from "gulp";

export default gulp.parallel(
  fpPDFTask("common"),
  fpPDFTask(www)
);

function fpPDFTask(sDir:string){
  return async function(){
    gulp.src("dev/pdfs/"+sDir+"/*.pdf")
    .pipe(gulp.dest("test/pdfs/"+sDir+"/"));
  };
};

Terminal output / screenshots

As above (ie the "Error")

Please provide the following information:

  • OS & version: Rocky Linux v9.5
  • node version: v23.8.0
  • npm version: 11.2.0
  • gulp version: CLI version: 3.0.0, Local version: 5.0.0

Additional information

When the above gulpfile.ts/index.ts are renamed gulpfile.js/index.js (and the sDir:string is changed to sDir) everything works AOK.

Happy to be shown this is not a bug (in Gulp) but is a config error on my part or an issue in (for eg) TS-Node, etc.

Thanks

Dulux-Oz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant