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

Cannot resolve scss dependency when using root / path #1555

Closed
absentees opened this issue Jun 16, 2018 · 0 comments · Fixed by #1993
Closed

Cannot resolve scss dependency when using root / path #1555

absentees opened this issue Jun 16, 2018 · 0 comments · Fixed by #1993
Labels

Comments

@absentees
Copy link

🐛 bug report

Unable to import a .scss file when using an absolute path i.e. /src/css/main.scss

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

Installed parcel-bundler globally with yarn

{
  "name": "parcel-test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "node-sass": "^4.9.0"
  },
  "scripts": {
    "dev":"parcel watch index.html"
  }
}

🤔 Expected Behavior

Compile and include css file

😯 Current Behavior

$ parcel watch index.html
🚨  /home/scott/Development/parcel-test/index.html: Cannot resolve dependency '/home/scott/Development/parcel-test/src/css/main.scss' at '/home/scott/Development/parcel-tes
    at Resolver.resolve (/home/scott/.config/yarn/global/node_modules/parcel-bundler/src/Resolver.js:70:17)
    at <anonymous>
events.js:183
      throw er; // Unhandled 'error' event

💁 Possible Solution

Thought there may be something im doing in regards to where the entry point is and where parcel is run from but no luck.

🔦 Context

Trying to parcel to compile a static site, basic html, js and css.

💻 Code Sample

Example repo: https://github.com/absentees/parcel-test

🌍 Your Environment

Software Version(s)
Parcel 1.9.0
Node 8.11.3
npm/Yarn 1.7.0
Operating System Ubuntu 18.04 LTS
DeMoorJasper pushed a commit that referenced this issue Sep 6, 2018
Fix "Cannot resolve dependency" errors for valid slash and tilde paths.

Before:

    /src/js/index.js
      -> /home/user/my-project/src/js/index.js
      -> /home/user/my-project/home/user/my-project/src/js/index.js

Error:

    Cannot resolve dependency /home/user/my-project/src/js/index.js

After:

    /src/js/index.js
      -> /home/user/my-project/src/js/index.js

The code already has a way for asset-handlers to signal to the bundler that a dependency has been resolved to an absolute path, but it isn't being used.

fixes #1555
fixes #1986
devongovett pushed a commit that referenced this issue Oct 15, 2018
Fix "Cannot resolve dependency" errors for valid slash and tilde paths.

Before:

    /src/js/index.js
      -> /home/user/my-project/src/js/index.js
      -> /home/user/my-project/home/user/my-project/src/js/index.js

Error:

    Cannot resolve dependency /home/user/my-project/src/js/index.js

After:

    /src/js/index.js
      -> /home/user/my-project/src/js/index.js

The code already has a way for asset-handlers to signal to the bundler that a dependency has been resolved to an absolute path, but it isn't being used.

fixes #1555
fixes #1986
devongovett pushed a commit that referenced this issue Oct 15, 2018
Fix "Cannot resolve dependency" errors for valid slash and tilde paths.

Before:

    /src/js/index.js
      -> /home/user/my-project/src/js/index.js
      -> /home/user/my-project/home/user/my-project/src/js/index.js

Error:

    Cannot resolve dependency /home/user/my-project/src/js/index.js

After:

    /src/js/index.js
      -> /home/user/my-project/src/js/index.js

The code already has a way for asset-handlers to signal to the bundler that a dependency has been resolved to an absolute path, but it isn't being used.

fixes #1555
fixes #1986
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants