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

Warning Icon - start - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. #112

Open
cctv18 opened this issue Jun 10, 2024 · 4 comments

Comments

@cctv18
Copy link

cctv18 commented Jun 10, 2024

Environment: Windows 10 Professional + Apache 2.4.39 + PHP 7.4.5, installed necessary php extensions (pdo_sqlite, mbstring, openssl, intl & gd2) and newest dokuwiki sqlite plugin, having set upload_max_filesize and post_max_size to 300M
Just when I installed Combo plugin and activated it, all content pages started to display abnormally, with a line of red text like this:

Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory).

image

and when I disable Combo plugin, everything returns to normal. Here's the log messages in the console tool of Edge:

combo.min.js:1 Uncaught SyntaxError: Unexpected token '<'
cache.js:1 Uncaught SyntaxError: Unexpected token '<'
metadata.js:1 Uncaught SyntaxError: Unexpected token '<'
combo-search-box.js:1 Uncaught SyntaxError: Unexpected token '<'
(索引):549 Uncaught TypeError: Cannot read properties of undefined (reading 'create')
at (索引):549:10

and the error log of Dokuwiki:

2024-06-07T10:29:33+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:29:38+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:30:20+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:30:28+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:30:33+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:30:46+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:31:02+08:00 - error - ComboStrap - event - Sqlite is mandatory for asynchronous event - 127.0.0.1 - start
2024-06-07T10:31:07+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon
2024-06-11T03:46:06+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory). - 127.0.0.1 - start
2024-06-11T03:46:06+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory). - 127.0.0.1 - start
2024-06-11T03:46:28+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory). - 127.0.0.1 - start
2024-06-11T03:46:28+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory). - 127.0.0.1 - start
2024-06-11T04:12:22+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory). - 127.0.0.1 - start
2024-06-11T04:12:22+08:00 - warning - ComboStrap - icon - Icon (). Error while rendering: We can't get the icon path. Error: The icon (mdi:vector-combine) could not be downloaded. Error: (We couldn't find the icon vector-combine) from the library mdi. Error: fopen(): php_network_getaddresses: getaddrinfo failed: ����������Ч�������Ҳ����������͵���ݡ� .. (ie media or icon name attribute is mandatory). - 127.0.0.1 - start

Meanwhile, I noticed the error information in the console tool of Edge, which the path of JS files was shown like this:
http://127.0.0.1/_media/library/combo/combo.min.js?drive=combo&fetcher=raw&tseed=1717952350
http://127.0.0.1/_media/snippet/js/cache.js?drive=combo&fetcher=raw&tseed=1717952350
http://127.0.0.1/_media/snippet/js/metadata.js?drive=combo&fetcher=raw&tseed=1717952350
http://127.0.0.1/_media/snippet/js/combo-search-box.js?drive=combo&fetcher=raw&tseed=1717952350
image
however, there's not a single directory named "_media" under the root directory of my website. Is it a problem caused by path reference, a bug or anything else?

@gerardnico
Copy link
Member

gerardnico commented Jun 11, 2024

Hy cctv18!

Sorry for that. Man.

vector-combine
vector-combine is the logo of combostrap.
Combostrap downloads the icons the first time when it does not find them. The error gives even the [url](https://raw.githubusercontent.com/Templarian/MaterialDesign/master/svg/vector-combine.svg)

The error in php is here:

Error: fopen(): php_network_getaddresses: getaddrinfo failed

Php uses the getaddrinfo to detect the IP server from the server raw.githubusercontent.com . And it couldn't.
This is a DNS problem.

_media
You get the _media path because the rewrite is configured but it seems that the rewrite is not. In Apache, you need a htaccess, on nginx, you need another one.
See here for all configuration by web server.

This errors:

http://127.0.0.1/_media/snippet/js/cache.js?drive=combo&fetcher=raw&tseed=1717952350

are because you get not a javascript but a HTML error page I presume.
You should copy the URL into the browser to see them.

@gerardnico
Copy link
Member

I created a test page without any rewrite.
And it works for me on our demo.

@cctv18 cctv18 closed this as completed Jun 12, 2024
@cctv18
Copy link
Author

cctv18 commented Jun 12, 2024

Thank you!
I tried to set jquerycdn to use code.jquery.com as CDN in dokuwiki's configuration setting, turn off URL rewrite and refresh the page, and the page seemed to be normal. Then I turned on URL rewrite again, there was still no error in the console tool of Edge.
However, when I tried to click the function buttons, the buttons were not corresponding, and there were errors appearing in the console of Edge:

/#:90 [Intervention]Images loaded lazily and replaced with placeholders. Load events are deferred. See https://go.microsoft.com/fwlink/?linkid=2048113
DevTools failed to load source map: Could not load content for http://127.0.0.1/_media/library/bootstrap/5.0.1/bootstrap.min.css.map: HTTP error: Status code 404,net::ERR_HTTP_RESPONSE_CODE_FAILURE
combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Modal')
at N.build (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:3716)
at N.show (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:2900)
at HTMLAnchorElement. (cache.js?drive=combo&fetcher=raw&tseed=1715531208:99:22)
build @ combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24
show @ combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24
(匿名) @ cache.js?drive=combo&fetcher=raw&tseed=1715531208:99
metadata.js?drive=combo&fetcher=raw&tseed=1715531208:207 TypeError: Cannot read properties of undefined (reading 'Modal')
at N.build (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:3716)
at N.show (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:2900)
at openMetadataManager (metadata.js?drive=combo&fetcher=raw&tseed=1715531208:192:18)
(匿名) @ metadata.js?drive=combo&fetcher=raw&tseed=1715531208:207
Promise.catch(异步)
(匿名) @ metadata.js?drive=combo&fetcher=raw&tseed=1715531208:205
combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Modal')
at N.build (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:3716)
at N.show (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:2900)
at HTMLAnchorElement. ((索引):340:22)
build @ combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24
show @ combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24
(匿名) @ (索引):340
combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Modal')
at N.build (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:3716)
at N.show (combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24:2900)
at HTMLAnchorElement. ((索引):296:22)
build @ combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24
show @ combo.min.js?drive=combo&fetcher=raw&tseed=1715531208:24
(匿名) @ (索引):296

and when I refresh the page again, the index bar and some of the font display in the page appeared to be abnormal:
image
Meanwhile, when I tried to open another page, a large number of warning/error prompts appeared on the page:
image
I really have no way to solve the problems above. Is this because of some runtime environment missing or some plugin conflict?

@cctv18 cctv18 reopened this Jun 12, 2024
@gerardnico
Copy link
Member

The error is here

TypeError: Cannot read properties of undefined (reading 'Modal')

combo.min.js is a wrapper around bootstrap js to create modals.

It means that bootstrap JavaScript was not loaded.

Combostrap is already on cdn since a couple of years long before dokuwiki implemented it.
It has no impact with Combostrap because it does not use this configuration.

As specified here:
https://combostrap.com/performance/strap-cdn-m55ukl58

For the warnings, Combostrap detects every xml tag in a page for performance reason.

https://combostrap.com/docs/combostrap-styling-marki-language-31meei51

If you want br, p tag to be printed you need to escape them with 2 percentage characters before and after them.

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

2 participants