Giter Site home page Giter Site logo

Comments (7)

nex3 avatar nex3 commented on June 3, 2024

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.

sbertault avatar sbertault commented on June 3, 2024

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.

nex3 avatar nex3 commented on June 3, 2024

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.

sbertault avatar sbertault commented on June 3, 2024

@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.

nex3 avatar nex3 commented on June 3, 2024

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.

guorun avatar guorun commented on June 3, 2024

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.

sbertault avatar sbertault commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.