ComboStrap / combo

Dokuwiki Combo Plugin. Making Web Publication a Breeze
https://combostrap.com
GNU General Public License v2.0
14 stars 4 forks source link

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 4 weeks ago

cctv18 commented 4 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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

cctv18 commented 3 weeks ago

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?

gerardnico commented 3 weeks ago

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.