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

@parcel/transformer-sass: The URL must be of scheme file #10019

Closed
jtojnar opened this issue Nov 25, 2024 · 1 comment
Closed

@parcel/transformer-sass: The URL must be of scheme file #10019

jtojnar opened this issue Nov 25, 2024 · 1 comment

Comments

@jtojnar
Copy link
Contributor

jtojnar commented Nov 25, 2024

🐛 bug report

After updating Parcel to 2.13.1, running parcel build index.html --dist-dir ../public/ --public-url ./ fails in SASS transformer with “The URL must be of scheme file” error.

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

.sassrc

{
  "silenceDeprecations": ["import"]
}

package.json

{
  "name": "selfoss-client",
  "dependencies": {
    "@fortawesome/free-brands-svg-icons": "^6.2.0",
    "@fortawesome/free-regular-svg-icons": "^6.2.0",
    "@fortawesome/free-solid-svg-icons": "^6.2.0",
    "@fortawesome/react-fontawesome": "^0.2.0",
    "@kunukn/react-collapse": "^3.0.0",
    "@parcel/service-worker": "^2.5.0",
    "@siteparts/show-hide-effects": "^1.0.0",
    "@szhsin/react-menu": "^4.0.0",
    "classnames": "^2.2.6",
    "core-js": "^3.2.1",
    "dexie": "^3.0.0",
    "focus-trap": "^7.0.0",
    "form-urlencoded": "^6.0.0",
    "html-escaper": "^3.0.0",
    "lodash-es": "^4.17.21",
    "prop-types": "^15.7.2",
    "prop-types-nullable": "^1.0.1",
    "ramda": "^0.30.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^5.2.0",
    "reset-css": "^5.0.1",
    "rooks": "^7.1.1",
    "tinykeys": "^2.0.0",
    "unreset-css": "^1.0.1",
    "use-state-with-deps": "^1.1.1",
    "yet-another-react-lightbox": "^3.5.0"
  },
  "devDependencies": {
    "@parcel/packager-raw-url": "^2.0.0",
    "@parcel/transformer-image": "^2.0.1",
    "@parcel/transformer-sass": "^2.0.0",
    "@parcel/transformer-webmanifest": "^2.0.0",
    "autoprefixer": "^10.4.0",
    "eslint": "^8.45.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-react": "^7.20.6",
    "eslint-plugin-react-hooks": "^4.2.0",
    "parcel": "^2.0.0",
    "postcss": "^8.4.4",
    "prettier": "^3.0.0",
    "process": "^0.11.10",
    "stylelint": "^16.0.0",
    "stylelint-config-standard-scss": "^13.0.0"
  },
  "scripts": {
    "fix": "npm run fix:js && npm run fix:styles",
    "fix:styles": "npm run fix:styles:lint && npm run fix:styles:prettify",
    "fix:styles:lint": "npm run check:styles:lint -- --fix",
    "fix:styles:prettify": "npm run check:styles:prettify -- --write",
    "fix:js": "npm run fix:js:prettify && npm run fix:js:lint",
    "fix:js:lint": "npm run check:js:lint -- --fix",
    "fix:js:prettify": "npm run check:js:prettify -- --write",
    "check": "npm run check:js && npm run check:styles",
    "check:js": "npm run check:js:prettify && npm run check:js:lint",
    "check:js:lint": "eslint --ext .jsx,.js .",
    "check:js:prettify": "prettier '**.{jsx,js}' --check",
    "check:styles": "npm run check:styles:lint && npm run check:styles:prettify",
    "check:styles:lint": "stylelint styles/*.scss",
    "check:styles:prettify": "prettier styles/*.scss --check",
    "dev": "parcel watch index.html --dist-dir ../public/ --public-url ./",
    "build": "parcel build index.html --dist-dir ../public/ --public-url ./"
  }
}

🤔 Expected Behavior

Build should succeed.

😯 Current Behavior

🚨 Build failed.

@parcel/transformer-sass: The URL must be of scheme file
  ╷
4 │ @import 'npm:reset-css/sass/reset';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  styles/main.scss 4:9  root stylesheet

  Error: The URL must be of scheme file
    ╷
  4 │ @import 'npm:reset-css/sass/reset';
    │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
    styles/main.scss 4:9  root stylesheet
      at Object.wrapException 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:2305:43)
      at Object.throwWithTrace0 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:32268:15)
      at 
  /home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:87601:19
      at _wrapJsFunctionForAsync_closure.$protected 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:5020:15)
      at _wrapJsFunctionForAsync_closure.call$2 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:38007:12)
      at _awaitOnObject_closure0.call$2 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:38001:25)
      at Object._rootRunBinary 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:5437:18)
      at StaticClosure.<anonymous> 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:124125:16)
      at _CustomZone.runBinary$3$3 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:39461:39)
      at _FutureListener.handleError$1 
  (/home/jtojnar/Projects/selfoss/client/node_modules/sass/sass.dart.js:38224:21)

💁 Possible Solution

🔦 Context

Tried to 2.13.0, which failed with #10010. Updated to 2.13.1 and got this issue.

💻 Code Sample

fossar/selfoss#1506

🌍 Your Environment

Software Version(s)
Parcel 2.13.1
Node 22.5.1
npm 10.8.2
Operating System NixOS Linux
@jtojnar
Copy link
Contributor Author

jtojnar commented Nov 25, 2024

Thanks, works great now.

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

No branches or pull requests

1 participant