Giter VIP home page Giter VIP logo

Comments (4)

GrimLink avatar GrimLink commented on May 29, 2024

Hi @bricebou I need to check why this is happening for this specific case.

Most likely the it an issue with sass-loader or encore or both, not sure yet.

I will first do a test, when I have time, of a clean install with just webpack and sass-loader
If this still works I will try using the full case, with encore.

The issue on top is error from sass-loader that it can not find @use "@fylgja/mq/helper", this error normally always relates to that the relative path is not set for /node_modules/.

See the Sass docs for load-path:

This weird since your own imports are using the relative path node_modules.
so this clearly a error somewhere and needs a bit of testing why.

from fylgja.

bricebou avatar bricebou commented on May 29, 2024

Thanks a lot ! I'll stay available if you need me to send more logs or test more :)

from fylgja.

GrimLink avatar GrimLink commented on May 29, 2024

Hi @bricebou, I believe I may have found a solution to your issue. It appears that you need to set the include path to ensure that all node relative paths are handled correctly when using sass-loader.

The problem seems to be related to how sass-loader handles imports from node_modules. In both cases that I tested (with Webpack and Encore), passing includePaths: ["node_modules"] was necessary, just like when using sass directly.

To fix your issue, please add the following code to your configuration:

const Encore = require('@symfony/webpack-encore');

// Other Encore options

Encore
  // Other Encore options

  .enableSassLoader((options) => {
    options.sassOptions = {
      includePaths: ["node_modules"],
    };
  }, {})
;

module.exports = Encore.getWebpackConfig();

Thank you for bringing this issue to my attention. I have also created a repository specifically for JS bundler cases like this, which you can find at fylgja/examples. I will add more options there later 😉.

from fylgja.

bricebou avatar bricebou commented on May 29, 2024

Great, thanks a lot @GrimLink ! I'll try that as soon as I can :-)

from fylgja.

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.