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

🐛 BUG: Using Bootstrap Icons' icon font causes MODULE_NOT_FOUND error #3888

Open
1 task done
martinburger opened this issue Mar 9, 2022 · 0 comments
Open
1 task done

Comments

@martinburger
Copy link

Quick checklist

  • I am using the latest version of Snowpack and all plugins.

What package manager are you using?

npm 8.5.1

What operating system are you using?

macOS 12.2.1

Describe the bug

Importing Bootstrap Icons in CSS file and adding icon to HTML file via icon font causes the following error:

[08:46:05] [snowpack] (/_snowpack/pkg/fonts/bootstrap-icons.woff2?524846017b983fc8ded9325d94ed40f3) Deprecated manual package import. Please use snowpack.getUrlForPackage() to create package URLs instead.
⠋ watching for file changes.../Users/[...]/app-template-blank-typescript/node_modules/resolve/lib/sync.js:111
    var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
              ^

Steps to reproduce

  1. npx create-snowpack-app app-template-blank-typescript --template @snowpack/app-template-blank-typescript
  2. cd app-template-blank-typescript
  3. npm install bootstrap-icons
  4. add @import 'bootstrap-icons/font/bootstrap-icons.css'; to public/index.css
  5. add <i class="bi bi-alarm"> to body of public/index.html
  6. npm start
  7. Error: Cannot find module 'fonts/bootstrap-icons.woff2?524846017b983fc8ded9325d94ed40f3' from '/Users/[...]/app-template-blank-typescript'

Details:

❯ npm start

> start
> snowpack dev

[08:46:04] [snowpack] Welcome to Snowpack! Because this is your first time running
this project, Snowpack needs to prepare your dependencies. This is a one-time step
and the results will be cached for the lifetime of your project. Please wait...
[08:46:04] [snowpack] + bootstrap-icons/font/[email protected]
[08:46:04] [snowpack] + [email protected]
[08:46:04] [snowpack] Ready!
[08:46:04] [snowpack] Server started in 17ms.
[08:46:04] [snowpack] Local: http://localhost:8080
[08:46:04] [snowpack] Network: http://192.168.1.114:8080
[08:46:04] [@snowpack/plugin-typescript] 7:45:04 AM - Starting compilation in watch mode...
[08:46:05] [snowpack] (/_snowpack/pkg/fonts/bootstrap-icons.woff2?524846017b983fc8ded9325d94ed40f3) Deprecated manual package import. Please use snowpack.getUrlForPackage() to create package URLs instead.
⠋ watching for file changes.../Users/[...]/app-template-blank-typescript/node_modules/resolve/lib/sync.js:111
    var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
              ^

Error: Cannot find module 'fonts/bootstrap-icons.woff2?524846017b983fc8ded9325d94ed40f3' from '/Users/[...]/app-template-blank-typescript'
    at Function.resolveSync [as sync] (/Users/[...]/app-template-blank-typescript/node_modules/resolve/lib/sync.js:111:15)
    at Object.resolveEntrypoint (/Users/[...]/app-template-blank-typescript/node_modules/esinstall/lib/entrypoints.js:149:59)
    at PackageSourceLocal.resolvePackageImport (/Users/[...]/app-template-blank-typescript/node_modules/snowpack/lib/cjs/sources/local.js:644:40)
    at handleRequest (/Users/[...]/app-template-blank-typescript/node_modules/snowpack/lib/cjs/commands/dev.js:722:49)
    at Server.<anonymous> (/Users/[...]/app-template-blank-typescript/node_modules/snowpack/lib/cjs/commands/dev.js:775:13)
    at Server.emit (node:events:527:28)
    at parserOnIncoming (node:_http_server:951:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17) {
  code: 'MODULE_NOT_FOUND'
}

Node.js v17.6.0

Link to minimal reproducible example (optional)

No response

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