vinyl-fs icon indicating copy to clipboard operation
vinyl-fs copied to clipboard

NodeJS 22 breaks vinyl-js

Open maximilianschmid opened this issue 1 year ago • 1 comments

What were you expecting to happen?

The task should copy the files

What actually happened?

The task throws an error and does not copy files

var gulp = require(‘gulp');

gulp.task('copyMailTemplates', () => {
  return gulp.src(['./src/templates/source/**/*.handlebars.html'])
    .pipe(gulp.dest('_temp/server/templates/source/'))
})

Terminal output / screenshots

>  npx gulp copyMailTemplates

[12:46:09] Using gulpfile ~/extendedbrain/planfred/server/gulpfile.js
[12:46:09] Starting 'copyMailTemplates'...
[12:46:09] 'copyMailTemplates' errored after 13 ms
[12:46:09] TypeError: Cannot assign to read only property 'atime' of object '#<Stats>'
    at onFutimes (/Users/milian/extendedbrain/planfred/server/node_modules/vinyl-fs/lib/file-operations.js:278:27)
    at FSReqCallback.oncomplete (node:fs:188:23)
    at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)

Please provide the following information:

  • MacOS Sonoma 14.4.1]:
  • node version 22.0.0:
  • npm version 10.5.2
  • gulp version CLI version: 3.0.0 Local version: 5.0.0

Additional information

The problem started to occur in NodeJS 22.0.0. The last 21.x dev was working.

I think this problem relates to this change in NodeJS 22

[6f504b71ac] - buffer: use simdutf for atob implementation (Yagiz Nizipli) #52381

How to patch this issue?

Patch file /vinyl-fs/lib/file-operations.js

uncomment lines 278, 779 and 284,285

CleanShot 2024-04-25 at 12 52 07

maximilianschmid avatar Apr 25 '24 10:04 maximilianschmid

This is a bug in Node.js - https://github.com/nodejs/node/issues/52707

nicolo-ribaudo avatar Apr 26 '24 13:04 nicolo-ribaudo

Huge shout-out to @nicolo-ribaudo for fixing this in upstream node! I'm going to close this out.

phated avatar Jun 25 '24 13:06 phated