v15 error when run in gulp via postCss and ESM
So I'm running gulp to process SASS, and I just updated this dependency from 14.1.0 to 15.0.0 and now when I try and run gulp I get an error.
An abridged version of my gulp CSS script that shows the error
import { src, dest } from 'gulp';
import gulpPostcss from 'gulp-postcss';
import postcssImport from 'postcss-import';
import { CONSTS } from './CONSTS';
const { CSS_DEST, NODE_ENV, SASS_SRC } = CONSTS;
const isDev = NODE_ENV !== 'production';
const gulpOptions = isDev ? { sourcemaps: true } : {};
function compileSass() {
const processors = [postcssImport];
return src(SASS_SRC + '/**/*.scss', gulpOptions)
.pipe(gulpPostcss(processors))
.pipe(dest(CSS_DEST, gulpOptions));
}
export { compileSass as sass };
Gives me the error:
/node_modules/postcss-import/index.js:45
if (styles.source?.input?.file) {
^
SyntaxError: Invalid or unexpected token
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
I couldn't see any relevant bugs having been raised recently that relate to this and there's nothing I could see in the changelog that suggests I need to modify anything, so wondering if it's a bug?
What's your Node.js version?
It's the latest LTS (Node 16.17.0 now, was 16.16 when I initially tried it)
That's strange, because the error you posted seems to indicate Node is failing to parse the optional chaining operator, but that should be fully supported by Node 16.
Could it be because I’m running in via esm?Sent from my iPhoneOn 7. Sep 2022, at 17:31, Ryan Zimmerman @.***> wrote: That's strange, because the error you posted seems to indicate Node is failing to parse the optional chaining operator, but that should be fully supported by Node 16.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Shouldn't affect it. I just tested with ESM (just using the postcss API, not gulp), and it worked fine for me. At this point, trying to build a minimal test case is probably your best option.
Closing for lack of reply.