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

Bootstrap sass imports result in error #10010

Closed
Julioevm opened this issue Nov 13, 2024 · 11 comments · Fixed by #10018
Closed

Bootstrap sass imports result in error #10010

Julioevm opened this issue Nov 13, 2024 · 11 comments · Fixed by #10018

Comments

@Julioevm
Copy link

🐛 bug report

scss import statements from bootstrap result in a:

Error: The "path" argument must be of type string or an instance of URL. Received null

🎛 Configuration (.babelrc, package.json, cli command)

{
  "name": "parcel-bootstrap-issue",
  "version": "1.0.0",
  "description": "reproduction for an issue with parcel 2.13.0",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "parcel build 'src/*.html'"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "bootstrap": "^5.3.3",
    "parcel": "2.13.0",
    "@parcel/transformer-sass": "2.13.0"
  }
}

🤔 Expected Behavior

Necessary imports are bundled correctly.

😯 Current Behavior

bootstrap scss import statements result in a:

Error: The "path" argument must be of type string or an instance of URL. Received null


**omiting some deprecation warnings**

🚨 Build failed.

@parcel/transformer-sass: The "path" argument must be of type string or an instance of URL. Received null
  ╷
1 │ @import "mixins/banner";
  │         ^^^^^^^^^^^^^^^
  ╵
  node_modules/bootstrap/scss/bootstrap-reboot.scss 1:9  @use
  src/style.scss 1:1                                     root stylesheet

  Error: The "path" argument must be of type string or an instance of URL. Received null
    ╷
  1 │ @import "mixins/banner";
    │         ^^^^^^^^^^^^^^^
    ╵
    node_modules/bootstrap/scss/bootstrap-reboot.scss 1:9  @use
    src/style.scss 1:1                                     root stylesheet
      at Object.wrapException (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:2305:43)
      at Object.throwWithTrace0 (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:32212:15)
      at /Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:87502:19
      at _wrapJsFunctionForAsync_closure.$protected (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:5020:15)
      at _wrapJsFunctionForAsync_closure.call$2 (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:37950:12)
      at _awaitOnObject_closure0.call$2 (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:37944:25)
      at Object._rootRunBinary (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:5437:18)
      at StaticClosure.<anonymous> (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:123976:16)
      at _CustomZone.runBinary$3$3 (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:39404:39)
      at _FutureListener.handleError$1 (/Users/julio.valls/repos/parcel-bootstrap-issue/node_modules/sass/sass.dart.js:38167:21)

💁 Possible Solution

🔦 Context

We use some bootstrap sass stuff in our application, this was working fine in parcel 2.12.0 but trying to update results in the described issue.

💻 Code Sample

Simplified reproduction of the issue:

https://github.com/Julioevm/parcel-bootstrap-issue

🌍 Your Environment

Software Version(s)
Parcel 2.13.0
Node 21.4.0
npm/Yarn 10.2.4
Operating System Mac OS Sonoma (silicon) / Reproducible on CI linux container
@sumo
Copy link

sumo commented Nov 14, 2024

Can confirm it fails with bulma and a custom stylesheet

`@parcel/transformer-sass: The "path" argument must be of type string or an instance of URL. Received null

4 │ @use "sass";
│ ^^^^^^^^^^^

../node_modules/bulma/bulma.scss 4:1 @import
src/styles.scss 1:9 root stylesheet

Error: The "path" argument must be of type string or an instance of URL. Received null

4 │ @use "sass";
│ ^^^^^^^^^^^

../node_modules/bulma/bulma.scss 4:1 @import
src/styles.scss 1:9 root stylesheet
at Object.wrapException (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:2305:43)
at Object.throwWithTrace0 (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:32212:15)
at /home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:87502:19
at _wrapJsFunctionForAsync_closure.$protected (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:5020:15)
at _wrapJsFunctionForAsync_closure.call$2 (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:37950:12)
at _awaitOnObject_closure0.call$2 (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:37944:25)
at Object._rootRunBinary (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:5437:18)
at StaticClosure. (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:123976:16)
at _CustomZone.runBinary$3$3 (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:39404:39)
at _FutureListener.handleError$1 (/home/sumit/dev/matrixid-web/node_modules/sass/sass.dart.js:38167:21)`

@theweinzierl
Copy link

I have the same issue when upgrading to parcel 2.13.0, using a similar configuration like @Julioevm and @sumo.

@bacchilu
Copy link

I confirm the same error described above with Parcel 2.13.0.

@mariots
Copy link

mariots commented Nov 15, 2024

I am also facing the same issue when upgrading to parcel 2.13.0

@shanekunz
Copy link

Just confirming same issue with bootstrap. using ~2.12 instead of ^2 for now.

@Vresod
Copy link

Vresod commented Nov 21, 2024

Confirming same issue on parcel 2.13.0 and bootstrap 5.3.3.

@jord4nrowe
Copy link

jord4nrowe commented Nov 24, 2024

Hello having the same issue with parcel 2.13.0 and zurb foundation 6.9.0.

Also on Apple Silicon

@devongovett
Copy link
Member

What version of sass do you have installed?

jtojnar added a commit to fossar/selfoss that referenced this issue Nov 24, 2024
- @fortawesome/free-brands-svg-icons: 6.5.2 → 6.7.1
- @fortawesome/free-regular-svg-icons: 6.5.2 → 6.7.1
- @fortawesome/free-solid-svg-icons: 6.5.2 → 6.7.1

- parcel: 2.12.0 → 2.13.0
  https://github.com/parcel-bundler/parcel/releases/tag/v2.13.0
- @parcel/packager-raw-url: 2.12.0 → 2.13.0
- @parcel/service-worker: 2.12.0 → 2.13.0
- @parcel/transformer-image: 2.12.0 → 2.13.0
- @parcel/transformer-sass: 2.12.0 → 2.13.0

    parcel-bundler/parcel#10010

    DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

    More info and automated migrator: https://sass-lang.com/d/import

- @parcel/transformer-webmanifest: 2.12.0 → 2.13.0

- @szhsin/react-menu: 4.1.0 → 4.2.3
- autoprefixer: 10.4.19 → 10.4.20
- core-js: 3.37.1 → 3.39.0
- eslint: 8.57.0 → 8.57.1
- eslint-plugin-react: 7.34.3 → 7.37.2
- eslint-plugin-react-hooks: 4.6.2 → 4.6.2
- focus-trap: 7.5.4 → 7.6.2
- postcss: 8.4.39 → 8.4.49
- prettier: 3.3.2 → 3.3.3
- stylelint: 16.6.1 → 16.10.0
- yet-another-react-lightbox: 3.21.1 → 3.21.7
@jtojnar
Copy link
Contributor

jtojnar commented Nov 24, 2024

I can also reproduce this with the latest npm update, which bumped sass to 1.81.0.

Downgrading the sass version to the previous one with npm install --prefix client '[email protected]' --save-dev did get rid of the @import deprecation warning:

DEPRECATION WARNING: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

  ╷
4 │ @import 'npm:reset-css/sass/reset';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
    styles/main.scss 4:9  root stylesheet

But the error from the OP remained:

@parcel/transformer-sass: The "path" argument must be of type string or an instance of URL. Received null
  ╷
4 │ @import 'npm:reset-css/sass/reset';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵

@devongovett
Copy link
Member

Should be fixed by #10018. Note that you can suppress the SASS deprecation warnings rather than downgrading it. Add this to your .sassrc:

{
  "silenceDeprecations": ["import"]
}

@jtojnar
Copy link
Contributor

jtojnar commented Nov 25, 2024

Thanks, this helped but now I see a different error: #10019

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 a pull request may close this issue.

10 participants