Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Import errors with SASS between 1.63.0 and 1.63.3

Raimondo Mancino edited this page Jun 15, 2023 · 1 revision

If you're using SASS >=1.63.0 <1.63.4, you might see an error like this in your pipeline:

(node:3040) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
C:\***********\project\node_modules\sass\sass.node.js:1
import * as util from "util"
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.16.0

This error is related to SASS, in particular to https://github.com/sass/dart-sass/issues/1995 which causes the module not to load correctly.

The issue has been fixed with SASS 1.63.4, but because they changed their module architecture, we recommend upgrading to version 1.0.9 of our esbuild plugin.

Clone this wiki locally