Skip to content
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

ENOENT: No such file or directory (sass/postcss/tailwind) #183

Open
asertym opened this issue Aug 20, 2022 · 0 comments
Open

ENOENT: No such file or directory (sass/postcss/tailwind) #183

asertym opened this issue Aug 20, 2022 · 0 comments

Comments

@asertym
Copy link

asertym commented Aug 20, 2022

I started getting this error on a project that worked fine just a couple of months ago, is this issue related to tailwind?

gulp-notify: [gulp error in gulp-postcss] Error in plugin "gulp-postcss"
Message:
    ENOENT: no such file or directory, stat 'src/assets/styles/style.css'
Details:
    errno: -2
    syscall: stat
    code: ENOENT
    path: src/assets/styles/style.css
    fileName: src/assets/styles/style.css

Stack:
Error: ENOENT: no such file or directory, stat 'src/assets/styles/style.css'
    at Object.statSync (fs.js:1016:3)
    at trackModified (node_modules/tailwindcss/lib/lib/setupContextUtils.js:468:46)
    at Object.getContext (node_modules/tailwindcss/lib/lib/setupContextUtils.js:858:5)
    at node_modules/tailwindcss/lib/lib/setupTrackingContext.js:39:53
    at node_modules/tailwindcss/lib/processTailwindFeatures.js:38:11
    at plugins (node_modules/tailwindcss/lib/index.js:33:58)
    at LazyResult.runOnRoot (node_modules/postcss/lib/lazy-result.js:339:16)
    at LazyResult.runAsync (node_modules/postcss/lib/lazy-result.js:393:26)
    at LazyResult.async (node_modules/postcss/lib/lazy-result.js:221:30)
    at LazyResult.then (node_modules/postcss/lib/lazy-result.js:206:17)

Here's my task:

gulp.task("styles", function () {
  const stylesPath = PATH.assets + PATH.styles;
  return gulp
    .src(PATH.source + stylesPath + '**/*.scss') // source
    .pipe(
      plumber({
        errorHandler: onError,
      })
    )
    .pipe(changed(PATH.source + stylesPath + '**/*.scss')) // source
    .pipe(sourcemaps.init())
    .pipe(sassGlob())
    .pipe(sass({
        includePaths: ['node_modules'],
        errLogToConsole: true,
        outputStyle: "compressed",
      }).on('error', sass.logError))
    .pipe(postcss())
    .pipe(sourcemaps.write(PATH.maps))
    .pipe(gulp.dest(PATH.build + stylesPath)) // output
    .pipe(browser.stream());
});

I checked #179, which seems to be a similar problem, except that the workaround proposed is not viable in my case. There has to be a better way to fix this.

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