угловой проект 5 релиз - PullRequest
0 голосов
/ 24 июня 2018

Я использую angular-cli и внедрил nanogallery в свой проект, теперь я собираюсь построить свой проект: если я запусту

ng build --prod

после загрузки файла на хост он выдает следующие ошибки в консоли:

jQuery.Deferred exception: i is not a function R/</</<@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:148258
each@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:22422
R/</<@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:145805
R/<@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:145721
R@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:145629
h@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:108785
l@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:108322
r/this.initiateGallery2@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:237166
t.nanogallery2/i.init@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:263620
t.nanogallery2@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:263679
jQuery.fn.nanogallery2/<@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:271921
each@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:22422
each@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:21097
jQuery.fn.nanogallery2@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:271900
M4vW/j</l.prototype.loadBranches/</<@http://ankiweb.ir/4.1155fed864443988871c.chunk.js:1:19424
u@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:48959
r/</h<@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:49257
ZSR1/</</</u</t.prototype.invokeTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19495
onInvokeTask@http://ankiweb.ir/main.36efe7b363f6a9952e89.bundle.js:1:603433
ZSR1/</</</u</t.prototype.invokeTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19408
ZSR1/</</</i</e.prototype.runTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:14671
ZSR1/</</</c</e.invokeTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:20589
e/this.invoke<@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:20474
u/n.args[0]@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:35813
undefined



ERROR TypeError: "i is not a function"
Rhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:148258eachhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:22422Rhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:145805Rhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:145721Rhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:145629hhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:108785lhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:108322initiateGallery2http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:237166inithttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:263620nanogallery2http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:263679nanogallery2http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:271921eachhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:22422eachhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:21097nanogallery2http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:271900loadBrancheshttp://ankiweb.ir/4.1155fed864443988871c.chunk.js:1:19424uhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:48959hhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:49257invokeTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19495onInvokeTaskhttp://ankiweb.ir/main.36efe7b363f6a9952e89.bundle.js:1:603433invokeTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19408runTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:14671invokeTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:20589invokehttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:204740http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:35813

jQuery.Deferred exception: l.branches[u].gallery is undefined M4vW/j</l.prototype.loadBranches/</<@http://ankiweb.ir/4.1155fed864443988871c.chunk.js:1:19176
u@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:48959
r/</h<@http://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:49257
ZSR1/</</</u</t.prototype.invokeTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19495
onInvokeTask@http://ankiweb.ir/main.36efe7b363f6a9952e89.bundle.js:1:603433
ZSR1/</</</u</t.prototype.invokeTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19408
ZSR1/</</</i</e.prototype.runTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:14671
ZSR1/</</</c</e.invokeTask@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:20589
e/this.invoke<@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:20474
u/n.args[0]@http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:35813
undefined

ERROR TypeError: "l.branches[u].gallery is undefined"
loadBrancheshttp://ankiweb.ir/4.1155fed864443988871c.chunk.js:1:19176uhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:48959hhttp://ankiweb.ir/scripts.0334935c44e8c4e6422d.bundle.js:1:49257invokeTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19495onInvokeTaskhttp://ankiweb.ir/main.36efe7b363f6a9952e89.bundle.js:1:603433invokeTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:19408runTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:14671invokeTaskhttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:20589invokehttp://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:204740http://ankiweb.ir/polyfills.d248127361c9f04ac793.bundle.js:1:35813

все работает правильно, кроме «галереи»

, но если я запускаю

ng build

все в порядке, включая «Галерея»

кто-нибудь знает, в чем проблема!?

expected behaviour

result of ng build -- prod

спасибо!

1 Ответ

0 голосов
/ 23 марта 2019

Я решил эту производственную проблему, сославшись на не минимизированные версии jquery и nanogallery в angular.json

, поэтому измените это ...

        "scripts": [
          "node_modules/jquery/dist/jquery.min.js",
          "node_modules/nanogallery2/dist/jquery.nanogallery2.min.js"
        ]

на это ...

        "scripts": [
          "node_modules/jquery/dist/jquery.js",
          "node_modules/nanogallery2/dist/jquery.nanogallery2.js"
        ]

Я не понимаю, почему эта проблема была вызвана минимизацией и связыванием уже минимизированного плагина jquery для наногалереи.

...