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

dartsass: Unable to resolve directory paths to directory index files #12849

Closed
jmooring opened this issue Sep 13, 2024 · 4 comments · Fixed by #12850
Closed

dartsass: Unable to resolve directory paths to directory index files #12849

jmooring opened this issue Sep 13, 2024 · 4 comments · Fixed by #12850
Labels
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Sep 13, 2024

Details: https://discourse.gohugo.io/t/51528/15

Applicable to Sass imported as a Hugo module, Hugo is unable to resolve directory paths to directory index files.

For example, this:

@use foo/bar

does not resolve to any of these:

  • foo/bar/_index.scss
  • foo/bar/_index.sass
  • foo/bar/_index.css

This affects both @use and @forward rules. See:

func (t importResolver) CanonicalizeURL(url string) (string, error) {

Based on experimentation, we should resolve to a file instead of a directory when both exist with same base name:

assets/
└── sass/
    ├── foo/
    │   └── _index.scss
    ├── foo.scss
    └── main.scss    <-- @use "foo";

In the above, we should resolve to foo.scss instead of foo/_index.scss.

@bep
Copy link
Member

bep commented Sep 13, 2024

What is a "index file" and where is the spec?

@jmooring
Copy link
Member Author

@jmooring
Copy link
Member Author

To reiterate, the problem is limited to Sass imported as a Hugo module. If the files exist in the OS file system, directory imports work as expected.

@jmooring jmooring removed their assignment Sep 13, 2024
@bep bep modified the milestones: Unscheduled, v0.135.0 Sep 14, 2024
@cooperaj
Copy link

cooperaj commented Sep 14, 2024

Thanks for putting my inane forum ramblings together into a bug @jmooring. I really appreciate it. 😄

Was tearing my hair out with this one.

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.

3 participants