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

These relative modules were not found #1378

Closed
andrejins opened this issue Jul 19, 2022 · 6 comments · Fixed by #1566
Closed

These relative modules were not found #1378

andrejins opened this issue Jul 19, 2022 · 6 comments · Fixed by #1566
Labels
bug Something isn't working

Comments

@andrejins
Copy link

This started yesterday on alpine linux docker image, without using cache

  • Building for dev...
    ERROR Failed to compile with 2 errors7:09:56 AM
    These relative modules were not found:
  • ./fonts/"bootstrap-icons".woff2?8d200481aa7f02a2d63a331fc782cfaf in ./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-3-1!./node_modules/postcss-loader/src??ref--8-oneOf-3-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-3-3!./node_modules/bootstrap-icons/font/bootstrap-icons.scss
  • ./fonts/"bootstrap-icons".woff?8d200481aa7f02a2d63a331fc782cfaf in ./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-3-1!./node_modules/postcss-loader/src??ref--8-oneOf-3-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-3-3!./node_modules/bootstrap-icons/font/bootstrap-icons.scss

Initially we used v1.6.1, after this error tried to update icon pack to v1.9.1 with the same result.

on mac os deleted node modules, reinstalled bootstrap icons and the same started with v 1.6.1 and with version 1.9.1 it seems that file is corrupt and cannot be processed or something else, but for now I do not have any ideas how to solve build issue with bootstrap-icons. There could be some mismach or corrupted file.

@andrejins andrejins added the bug Something isn't working label Jul 19, 2022
@andrejins
Copy link
Author

found out how to solve. as we can see in relative path

$bootstrap-icons-font: "bootstrap-icons" !default;
is been taken with quotation marks
when removing them from bootstrap-icons.scss file everything works

Now it needs to be tested, but this behavior is in all releases

so $bootstrap-icons-font: bootstrap-icons !default; $bootstrap-icons-font-dir: "./fonts" !default; $bootstrap-icons-font-file: #{$bootstrap-icons-font-dir}/#{$bootstrap-icons-font} !default; $bootstrap-icons-font-hash: "8d200481aa7f02a2d63a331fc782cfaf" !default; $bootstrap-icons-font-src: url("#{$bootstrap-icons-font-file}.woff2?#{$bootstrap-icons-font-hash}") format("woff2"), url("#{$bootstrap-icons-font-file}.woff?#{$bootstrap-icons-font-hash}") format("woff") !default; ...
works

@mdo
Copy link
Member

mdo commented Aug 28, 2022

What's the compiler you're using?

@sveetch
Copy link

sveetch commented Sep 4, 2022

@mdo Hi, i've got almost the same issue, with the font name to be quoted in final compiled URL, compiler does not fail to compile however the font is not working since it includes quotes around the font name:

@font-face {
  font-display: block;
  font-family: "bootstrap-icons";
  src: url('./fonts/"bootstrap-icons".woff2?8d200481aa7f02a2d63a331fc782cfaf') format("woff2"), url('../fonts/"bootstrap-icons".woff?8d200481aa7f02a2d63a331fc782cfaf') format("woff"); }

I'm using node-sass==7.0.1, i've fixed it with changing the $bootstrap-icons-font-file variable to surround content with a quote so Sass know it's a full string and it can merge quotes:

$bootstrap-icons-font-file: "#{$bootstrap-icons-font-dir}/#{$bootstrap-icons-font}" !default;

Which results to :

@font-face {
  font-display: block;
  font-family: "bootstrap-icons";
  src: url("./fonts/bootstrap-icons.woff2?8d200481aa7f02a2d63a331fc782cfaf") format("woff2"), url("../fonts/bootstrap-icons.woff?8d200481aa7f02a2d63a331fc782cfaf") format("woff"); }

@aripddev
Copy link

I have the same problem since version 1.9.1. So i rolled back to version 1.9.0. I am using Hugo.

Screenshot 2022-11-12 at 12 02 06

@chriskrams
Copy link

Same problem in version 1.10.2.

I think the bootstrap.icons.scss line 3 needs quotation marks:
$bootstrap-icons-font-file: #{$bootstrap-icons-font-dir}/#{$bootstrap-icons-font} !default;

should look like that:
$bootstrap-icons-font-file: "#{$bootstrap-icons-font-dir}/#{$bootstrap-icons-font}" !default;

@MohaElder
Copy link

Got the same issue when trying to add @import '~bootstrap-icons'; in my styles.scss and having

alias: {
	'~bootstrap-icons': path.resolve(__dirname, 'node_modules/bootstrap-icons'),
	},

in my vite.config.js

The error message is

Error: Not found: /fonts/bootstrap-icons.woff2
    at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:396:13)
    at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:237:5)
    at #options.hooks.handle (/node_modules/@sveltejs/kit/src/runtime/server/index.js:41:55)
    at Module.respond (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:234:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /fonts/bootstrap-icons.woff
    at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:396:13)
    at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:237:5)
    at #options.hooks.handle (/node_modules/@sveltejs/kit/src/runtime/server/index.js:41:55)
    at Module.respond (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:234:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Thanks to @aripddev and @andrejins 's comments, I have resolved it by downgrading the version from 1.10.3 to 1.9.0 by running npm i bootstrap-icons@1.9.0

@mdo mdo closed this as completed in #1566 Mar 25, 2023
mdo pushed a commit that referenced this issue Mar 25, 2023
* fix for #1378 to fix sass quoted string interpolation for hugo 0.110.0

* Adds quotes to the scss.hbs file so it reflects what is in font/bootstrap-icons.scss

* Update bootstrap-icons.scss

* Putting the fix, adding quotes around the -icons-font-file variable, back after it was removed by ea46c09

* The font/bootstrap-icons.scss is auto generated, so changes should not be made manually.

---------

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants