Comments (7)
The first error here is related to node-sass, which is a different (deprecated) project.
The second error looks like it's failing to load the node:module
module. We did add a load of this module recently for CLI apps, but that module has been present in Node.js since v12 so I don't know why your app is having trouble with it.
What version of Node.js are you using? Do you have a stand-alone reproduction of this error, ideally without sass-loader
?
from dart-sass.
I face the same problem on my own computer (node 16.18.1 on Debian Linux) and in the CI (node 16, ubuntu docker image I think). The "module" package is required¹, but not declared in the dependencies section of package.json.
Had to add it manually.
I am far from being a node specialist, but I'm under the impression that "module" (embedded in Node) is available in the global scope and one shouldn't "require()" it (I also came across the syntax require("node:module")
)
¹ line 7 of sass.node.js : nodeModule: require("module")
from dart-sass.
The globally-available module
object is different from the module
module. Although you can use the node:
prefix to load built-in modules, it's not necessary. I've verified that console.log(require("module"))
works as expected in Node 16.18.1 on my machine. Can you try running that exact script with the node
CLI in the environment where you're seeing failures and report the result?
from dart-sass.
@nex3 Indeed console.log(require("module"))
does work as intended in both node interpreter and node script (launched directly from terminal or via npm in a sandbox project). I don't know what piece of context makes it different here.
My failing project uses vue2 cli typescript and babel FWIW
from dart-sass.
I'd recommend trying to strip out each of those components one by one until you figure out exactly which tool is causing this error, and then filing an issue against that tool.
from dart-sass.
please just check your .vue files. which file use some lines like
import * as sass from 'sass'
or
import { types } from 'sass'
or any lines want to import sass module
then delete them and try again .
I met same problems like you faced (node 16.20.2 on Linux)
It looks like this
This dependency was not found:
* module in ./node_modules/sass/sass.node.js
To install it, you can run: npm install --save module
and I found something... like import wrong packages in one .vue file and fix this problem. @sbertault
from dart-sass.
Thanks a lot @guorun ; you nailed it.
Someone mistakenly imported {Exception} from "sass"
in a vue file.
Just removed it, and upgrading to 1.71.1 or 1.72.0 now passes the build.
from dart-sass.
Related Issues (20)
- ESM export of `NodePackageImporter` is missing.
- Node package importer requires an entryPointDirectory in ESM HOT 1
- Deprecation message replaces underscores with hyphens HOT 2
- NodePackageImporter support for subpaths entry points without extensions HOT 8
- Doesnt execute custom functions in renderSync HOT 1
- Node Package Importer can't find ESM entry point if args are provided HOT 1
- An alternate way to define inheritance by utilizing nesting HOT 3
- SCSS silently fails to compile lines beginning with `--` HOT 1
- Miscompilation when Using Sass and CSS Variables HOT 1
- Drop support for plain-CSS-like functions and mixins
- update flag doesn't work with absolute source paths HOT 2
- change in distribution format HOT 4
- Does sass encourage terrorism, kidnapping, murder and rape?
- ImportCache of CanonicalizeResult is broken for relative imports handled by any importer that is not a baseImporter HOT 13
- {DELETE ME] HOT 1
- Running Dart Sass in QuickJS? HOT 4
- Unused code elimination and deduplication is not applied when using api: 'legacy' HOT 5
- font-awesome integration HOT 8
- I would like to know which version of dart-sass supports node v10.18.0? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-sass.