Skip to content
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

Fix sass import edge case #9256

Merged

Conversation

jondlm
Copy link
Contributor

@jondlm jondlm commented Sep 20, 2023

↪️ Pull Request

Fixes #7163.

Some packages, such as @primer/css, specify a sass property in their package.json that is a string. Parcel was throwing an error TypeError: Cannot create property 'importer' on string before this fix.

🚨 Test instructions

Test case included in the PR.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@mischnic
Copy link
Member

mischnic commented Sep 22, 2023

I think a better test case would be

    await fsFixture(overlayFS, dir)`
      index.js:
        import './main.css';

      main.css:
        @import './edge/main.scss'

      edge
        package.json:
          {
            "name": "edge",
            "sass": "main.scss"
          }

        main.scss:
          .foo {
            .bar {
              color: green;
            }
          }
        `;

because I'm actually surprised that the Sass transformer loads configs inside node_modules. Babel, PostCSS, PostHTML don't do this.

@mischnic mischnic merged commit 482ef2f into parcel-bundler:v2 Sep 26, 2023
16 checks passed
@jondlm jondlm deleted the jondlm-issue-7163-fix-sass-edge-case branch September 26, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when trying to import a .scss file from bootstrap into a .css file with parcel
3 participants