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
@use & @include doesn't work by default with yarn 3 / berry #1765
Comments
plus is not reading my vars when i use meta.load |
More info from sass-loader webpack-contrib/sass-loader#1077 |
Can you provide a reproduction for this that just uses the Dart Sass API? Custom importers are expected to work the same with |
I've tried to create a working npm & failing yarn repro, unfortunately I was not able to make npm work https://github.com/Lonli-Lokli/dart-sass-yarn It is failing with npm run build with error. Can you explain how this code should be modified to make npm work? @include works fine
|
I'm asking for a reproduction that doesn't depend on Webpack. As far as I know, that build error is just coming from the Webpack importer itself. |
@nex3 Can you please explain how can I provide an example without webpack, with loading external files from node_modules? |
I want you to provide an example of an importer for which Dart Sass is clearly behaving incorrectly. Whether it loads a file from |
The JS distribution of dart-sass on https://npmjs.com/sass uses Yarn documents this: https://yarnpkg.com/advanced/rulebook/#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies. The latter is relevant to me because the JS Bazel rules use pnpm's layout, so they don't work with sass. Here is a reproduction that depends only on the
Now run
|
Works around sass/dart-sass#1765 so that the npmjs.com/sass package can run under hoist=false.
Works around sass/dart-sass#1765 so that the npmjs.com/sass package can run under hoist=false.
Works around sass/dart-sass#1765 so that the npmjs.com/sass package can run under hoist=false.
Works around sass/dart-sass#1765 so that the npmjs.com/sass package can run under hoist=false.
@alexeagle That looks like expected behavior to me. If you run the Sass CLI (or JS API) without any additional options, it will only support relative loads. It has no built-in support for Node.js-style Today, the only things that can connect Sass to
|
Thanks for your detailed attention as always, @nex3 I believe there are actually two issues:
Now you can use that repro to observe that with
that the repro command (
The Node.js resolution algorithm is meant to begin the search in We can workaround this by adding another
as you can see, this fixes our error but introduces the next one. A user is forced to exhaustively follow the third-party dependency structure to enumerate every possible I think this issue #2 could be resolved with the existing |
Just to note that there are other packages managers (yarn, pnpm) which has their own vision on node_modules resolve |
@alexeagle The right way to handle this for the time being (or any issue of the class "just passing a simple |
Bug report
Actual Behavior
Build error with Yarn 3 &
@use
or@include
usageExpected Behavior
No build errors
How Do We Reproduce?
yarn install
yarn build
Same code with
@import
worksThe text was updated successfully, but these errors were encountered: