magento / m2-devtools

Helpful in-browser debugging/inspection tools for the Magento 2 Front-End
Open Software License 3.0
172 stars 48 forks source link

Bundeling javascript files throws error one jquery storageapi #44

Open dverkade opened 5 years ago

dverkade commented 5 years ago

This issue is a:

Environment

Question Answer
Magento version 2.3.0
Browser + version Chrome 71.0.3578.80
node.js version (node -v) v6.14.3
npm version (npm -v) 3.10.10

Description

I have runned the javascript bundling tool and executed all the steps as mentioned in the M2 devtools extension. However the shared.js bundle throws a javascript error on the jquery storageapi javascript file, see screenshot.

Expected result:

Javascript bundles work correctly and are no throwing errors.

Screenshot

image

Bundle.js file

The bundle.js file which was generated. ``` ({ // Set "optimize" to "none" to speed up bundling while debugging "optimize": "uglify2", "generateSourceMaps": true, "wrapShim": true, "inlineText": true, "modules": [ { // Modules used on > 1 page(s) of the store "name": "bundles/shared", "include": [ "jquery", "jquery/patches/jquery", "jquery/jquery.mobile.custom", "jquery/patches/jquery-ui", "jquery/jquery-migrate", "domReady", "matchMedia", "mage/smart-keyboard-handler", "mage/ie-class-fixer", "underscore", "mage/template", "mage/apply/scripts", "mage/apply/main", "mage/mage", "mage/translate", "Magento_Ui/js/lib/key-codes", "mage/utils/wrapper", "es6-collections", "text!ui/template/modal/modal-popup.html", "text!ui/template/modal/modal-slide.html", "text!ui/template/modal/modal-custom.html", "jquery/jquery.cookie", "Magento_Ui/js/lib/registry/registry", "text!ui/template/tooltip/tooltip.html", "jquery/ui", "mage/translate-inline", "Magento_Ui/js/modal/modal", "Magento_Ui/js/modal/confirm", "mage/dataPost", "knockoutjs/knockout", "knockoutjs/knockout-es5", "Magento_Ui/js/lib/knockout/extender/observable_array", "knockoutjs/knockout-fast-foreach", "knockoutjs/knockout-repeat", "Magento_Ui/js/lib/core/events", "Magento_Ui/js/lib/knockout/extender/bound-nodes", "Magento_Ui/js/lib/knockout/bindings/mage-init", "Magento_Ui/js/lib/knockout/bindings/fadeVisible", "tinycolor", "jquery/jquery-storageapi",z "mage/collapsible", "mage/tabs", "Magento_Ui/js/lib/knockout/template/loader", "Magento_Ui/js/lib/knockout/template/renderer", "Magento_Ui/js/lib/knockout/bindings/i18n", "Magento_Ui/js/lib/knockout/bindings/range", "Magento_Ui/js/lib/knockout/bindings/keyboard", "Magento_Ui/js/lib/knockout/bindings/after-render", "Magento_Ui/js/lib/knockout/bindings/autoselect", "Magento_Ui/js/lib/knockout/bindings/outer_click", "Magento_Ui/js/lib/knockout/bindings/collapsible", "Magento_Ui/js/lib/knockout/bindings/staticChecked", "Magento_Ui/js/lib/knockout/bindings/simple-checked", "Magento_Ui/js/lib/knockout/bindings/bind-html", "Magento_Ui/js/lib/knockout/bindings/tooltip", "Magento_Ui/js/lib/logger/message-pool", "Magento_Ui/js/lib/logger/levels-pool", "Magento_Ui/js/lib/logger/logger", "Magento_Ui/js/lib/logger/console-output-handler", "Magento_Ui/js/lib/logger/logger-utils", "moment", "spectrum", "Magento_Ui/js/lib/knockout/bindings/color-picker", "Magento_Ui/js/lib/view/utils/bindings", "mage/utils/objects", "mage/utils/compare", "jquery/jquery-ui-timepicker-addon", "mage/calendar", "mage/utils/strings", "mage/utils/arrays", "mage/utils/template", "Magento_Ui/js/lib/logger/formatter", "Magento_Ui/js/lib/logger/entry", "Magento_Ui/js/lib/logger/entry-factory", "FormData", "mage/utils/misc", "mage/utils/main", "Magento_Ui/js/lib/knockout/bindings/optgroup", "Magento_Ui/js/lib/knockout/bindings/datepicker", "Magento_Ui/js/lib/core/class", "Magento_Ui/js/lib/knockout/template/observable_source", "Magento_Ui/js/lib/core/storage/local", "Magento_Ui/js/lib/logger/console-logger", "Magento_Ui/js/lib/knockout/template/engine", "Magento_Ui/js/lib/knockout/bindings/scope", "MutationObserver", "domReady!", "Magento_Theme/js/responsive", "Magento_Theme/js/theme", "mage/common", "Magento_Ui/js/lib/view/utils/dom-observer", "Magento_Ui/js/lib/view/utils/async", "Magento_Ui/js/lib/knockout/bindings/resizable", "Magento_Ui/js/lib/knockout/bindings/bootstrap", "Magento_Ui/js/lib/knockout/bootstrap", "mage/bootstrap", "mage/loader", "mage/dropdowns", "mage/dropdown", "Magento_Search/js/form-mini", "mage/menu", "mage/trim-input", "mage/translate-init", "mage/cookies", "Magento_PageCache/js/page-cache", "Magento_Ui/js/block-loader", "Magento_Customer/js/section-config", "Magento_Ui/js/core/renderer/types", "Magento_Ui/js/core/renderer/layout", "Magento_Ui/js/core/app", "text!ui/template/block-loader.html", "mage/url", "mage/storage", "Magento_Customer/js/customer-data", "Magento_Ui/js/lib/core/element/links", "Magento_Ui/js/lib/core/element/element", "Magento_Customer/js/invalidation-processor", "Magento_Ui/js/lib/core/collection", "Magento_Tax/js/view/checkout/minicart/subtotal/totals", "Magento_Msrp/js/view/checkout/minicart/subtotal/totals", "Magento_Catalog/js/view/image", "Magento_Customer/js/view/customer", "jquery/jquery.metadata", "jquery/validate", "mage/validation", "mage/validation/validation", "Magento_Wishlist/js/view/wishlist", "Magento_Theme/js/view/messages", "Magento_Customer/js/invalidation-rules/website-rule", "mage/decorate", "Magento_Catalog/js/view/compare-products", "Magento_Customer/js/model/authentication-popup", "Magento_Ui/js/modal/alert", "Magento_Checkout/js/sidebar", "Magento_Checkout/js/view/minicart", "MSP_ReCaptcha/js/registry", "MSP_ReCaptcha/js/reCaptcha", "MSP_ReCaptcha/js/ui-messages-mixin", "Magento_Captcha/js/model/captchaList", "Magento_Ui/js/lib/spinner", "mage/requirejs/resolver", "Magento_Catalog/js/product/storage/ids-storage", "Magento_Catalog/js/product/storage/ids-storage-compare", "text!Magento_Checkout/template/minicart/content.html", "Magento_Captcha/js/action/refresh", "Magento_Captcha/js/model/captcha", "Magento_Captcha/js/view/checkout/defaultCaptcha", "Magento_Catalog/js/product/query-builder", "Magento_Catalog/js/product/storage/data-storage", "Magento_Catalog/js/product/storage/storage-service", "Magento_Catalog/js/storage-manager", "Magento_Ui/js/form/adapter/buttons", "Magento_Ui/js/form/adapter", "Magento_Ui/js/form/form", "text!ui/template/collection.html", "Magento_Ui/js/model/messages", "Magento_Ui/js/model/messageList", "Magento_Customer/js/action/login", "Magento_Customer/js/view/authentication-popup", "Magento_Captcha/js/view/checkout/loginCaptcha", "Magento_Ui/js/view/messages", "text!Magento_Customer/template/authentication-popup.html", "text!Magento_Ui/template/messages.html", "text!MSP_ReCaptcha/template/reCaptcha.html", "text!Magento_Captcha/template/checkout/captcha.html", "Magento_Cookie/js/require-cookie", "text!Magento_Checkout/template/minicart/item/default.html", "text!Magento_Checkout/template/minicart/subtotal.html", "text!Magento_Catalog/template/product/image_with_borders.html", "text!Magento_Checkout/template/minicart/item/price.html", "text!Magento_Tax/template/checkout/minicart/subtotal/totals.html", "Magento_Catalog/js/price-utils", "jquery/jquery.parsequery", "Magento_Swatches/js/swatch-renderer", "Magento_Wishlist/js/add-to-wishlist", "Magento_Catalog/js/price-box", "Magento_Catalog/js/product/view/product-ids", "Magento_Catalog/js/product/view/product-ids-resolver", "Magento_Catalog/js/catalog-add-to-cart", "Magento_Checkout/js/model/shipping-rates-validation-rules", "Magento_Checkout/js/model/quote", "Magento_Tax/js/view/checkout/shipping_method/price", "Magento_Checkout/js/checkout-data", "Magento_Checkout/js/model/totals", "Magento_OfflineShipping/js/model/shipping-rates-validation-rules/flatrate", "Magento_OfflineShipping/js/model/shipping-rates-validator/flatrate", "Magento_OfflineShipping/js/model/shipping-rates-validation-rules/tablerate", "Magento_OfflineShipping/js/model/shipping-rates-validator/tablerate", "Magento_Checkout/js/model/shipping-address/form-popup-state", "Magento_Checkout/js/action/select-shipping-method", "Magento_Checkout/js/model/step-navigator", "Magento_Checkout/js/view/summary/abstract-total", "Magento_Tax/js/view/checkout/summary/subtotal", "Magento_Tax/js/view/checkout/summary/grand-total", "Magento_SalesRule/js/view/summary/discount", "Magento_Tax/js/view/checkout/summary/tax", "Magento_Weee/js/view/checkout/summary/weee", "Magento_Checkout/js/view/summary/shipping", "Magento_Tax/js/view/checkout/summary/shipping", "Magento_Checkout/js/action/select-shipping-address", "Magento_Checkout/js/model/postcode-validator", "Magento_Checkout/js/model/default-post-code-resolver", "Magento_Checkout/js/action/select-billing-address", "Magento_Checkout/js/action/select-payment-method", "Magento_Checkout/js/model/url-builder", "Magento_Checkout/js/model/error-processor", "Magento_Checkout/js/model/new-customer-address", "Magento_Checkout/js/model/address-converter", "Magento_Checkout/js/action/create-billing-address", "Magento_Checkout/js/model/payment/method-list", "Magento_Checkout/js/model/payment-service", "Magento_Checkout/js/model/default-validation-rules", "Magento_Checkout/js/model/default-validator", "Magento_Checkout/js/model/shipping-rates-validator", "Magento_OfflineShipping/js/view/shipping-rates-validation/flatrate", "Magento_OfflineShipping/js/view/shipping-rates-validation/tablerate", "Magento_Ui/js/lib/validation/utils", "Magento_Ui/js/lib/validation/rules", "Magento_Ui/js/lib/validation/validator", "Magento_Ui/js/form/element/abstract", "Magento_Ui/js/form/element/select", "Magento_Ui/js/form/element/region", "Magento_Checkout/js/model/shipping-rate-registry", "Magento_Customer/js/model/customer/address", "Magento_Customer/js/model/customer-addresses", "Magento_Customer/js/model/address-list", "Magento_Checkout/js/action/create-shipping-address", "Magento_Checkout/js/model/checkout-data-resolver", "Magento_Checkout/js/model/shipping-service", "Magento_Customer/js/model/customer", "Magento_Checkout/js/model/resource-url-manager", "Magento_Checkout/js/model/shipping-rate-processor/new-address", "text!Magento_Tax/template/checkout/summary/subtotal.html", "text!Magento_Weee/template/checkout/summary/weee.html", "text!ui/template/form/field.html", "text!ui/template/form/element/select.html", "text!ui/template/form/element/input.html", "text!Magento_Tax/template/checkout/shipping_method/price.html", "mage/toggle" ], "exclude": [], "create": true }, { "name": "bundles/checkout-index-index", "create": true, "include": [ "Magento_Checkout/js/checkout-loader", "Magento_Ui/js/form/components/group", "Magento_Checkout/js/view/summary/item/details", "Magento_Checkout/js/view/summary/item/details/thumbnail", "Magento_Checkout/js/view/shipping-information/list", "Magento_Checkout/js/model/full-screen-loader", "Magento_Shipping/js/model/config", "Magento_Shipping/js/view/checkout/shipping/shipping-policy", "Magento_Checkout/js/model/payment/method-converter", "Magento_Checkout/js/model/payment/renderer-list", "Magento_Payment/js/view/payment/payments", "Magento_Paypal/js/view/payment/paypal-payments", "Magento_OfflinePayments/js/view/payment/offline-payments", "Magento_Checkout/js/model/payment/additional-validators", "Magento_CheckoutAgreements/js/model/agreements-modal", "Magento_CheckoutAgreements/js/view/checkout-agreements", "Magento_Checkout/js/view/summary", "Magento_Checkout/js/view/summary/cart-items", "Magento_Checkout/js/view/summary/totals", "Magento_Checkout/js/view/summary/item/details/subtotal", "Magento_Tax/js/view/checkout/summary/item/details/subtotal", "Magento_Weee/js/view/checkout/summary/item/price/weee", "Magento_Weee/js/view/checkout/summary/item/price/row_incl_tax", "Magento_Weee/js/view/checkout/summary/item/price/row_excl_tax", "Magento_Customer/js/action/check-email-availability", "text!Magento_Checkout/template/onepage.html", "Magento_Checkout/js/model/authentication-messages", "Magento_Checkout/js/view/authentication-messages", "Magento_SalesRule/js/model/payment/discount-messages", "Magento_SalesRule/js/view/payment/discount-messages", "Magento_CheckoutAgreements/js/model/agreement-validator", "Magento_CheckoutAgreements/js/view/agreement-validation", "Klarna_Kp/js/model/config", "Klarna_Kp/js/action/override", "Magento_Checkout/js/model/sidebar", "Magento_Checkout/js/view/sidebar", "Magento_Checkout/js/view/shipping-address/list", "Magento_Checkout/js/view/form/element/email", "Magento_Checkout/js/view/authentication", "Magento_Checkout/js/model/customer-email-validator", "Magento_Checkout/js/view/payment/email-validator", "Magento_Checkout/js/action/get-payment-information", "Magento_SalesRule/js/action/set-coupon-code", "Magento_SalesRule/js/action/cancel-coupon", "Magento_SalesRule/js/view/payment/discount", "Magento_Checkout/js/action/set-billing-address", "Magento_Checkout/js/view/payment", "Magento_Checkout/js/view/payment/list", "Magento_Checkout/js/model/shipping-rate-processor/customer-address", "Magento_Checkout/js/model/shipping-rate-service", "Magento_Checkout/js/view/billing-address", "Magento_Ui/js/form/element/post-code", "Magento_Checkout/js/model/shipping-save-processor/payload-extender", "Magento_Checkout/js/model/shipping-save-processor/default", "Magento_Checkout/js/model/shipping-save-processor", "Magento_Checkout/js/action/set-shipping-information", "Magento_Checkout/js/view/shipping", "Magento_Checkout/js/view/estimation", "text!Magento_Checkout/template/sidebar.html", "Magento_Checkout/js/model/payment/method-group", "text!Magento_Checkout/template/payment.html", "text!Magento_Checkout/template/authentication.html", "text!Magento_Checkout/template/summary.html", "text!Magento_Checkout/template/shipping.html", "text!Magento_Checkout/template/estimation.html", "text!Magento_Checkout/template/payment-methods/list.html", "text!Magento_SalesRule/template/payment/discount.html", "Magento_Checkout/js/view/progress-bar", "Magento_Checkout/js/view/shipping-information", "Temando_Shipping/js/model/collection-points", "Temando_Shipping/js/model/pickup-locations", "Temando_Shipping/js/view/checkout/shipping-information/address-renderer/shipping", "text!Magento_Checkout/template/summary/totals.html", "text!Magento_Checkout/template/summary/cart-items.html", "text!Magento_Checkout/template/form/element/email.html", "text!Magento_Checkout/template/shipping-address/list.html", "text!Magento_Checkout/template/shipping-address/form.html", "text!Magento_Shipping/template/checkout/shipping/shipping-policy.html", "text!Magento_Checkout/template/shipping-address/shipping-method-list.html", "text!Magento_Checkout/template/summary/item/details.html", "text!Magento_Checkout/template/progress-bar.html", "text!Magento_Checkout/template/shipping-information.html", "text!ui/template/group/group.html", "text!Magento_Checkout/template/shipping-address/shipping-method-item.html", "text!Magento_Checkout/template/summary/item/details/thumbnail.html", "text!Magento_Tax/template/checkout/summary/item/details/subtotal.html", "text!ui/template/form/element/helper/tooltip.html", "text!Magento_Weee/template/checkout/summary/item/price/row_incl_tax.html", "text!Magento_SalesRule/template/summary/discount.html", "text!Magento_Tax/template/checkout/summary/shipping.html", "text!Magento_Tax/template/checkout/summary/tax.html", "text!Magento_Tax/template/checkout/summary/grand-total.html", "text!Magento_Checkout/template/shipping-information/list.html", "text!Magento_Checkout/template/shipping-information/address-renderer/default.html", "Magento_Checkout/js/action/redirect-on-success", "Magento_Checkout/js/model/place-order", "Magento_Checkout/js/action/place-order", "Magento_CheckoutAgreements/js/model/agreements-assigner", "Magento_CheckoutAgreements/js/model/place-order-mixin", "Magento_Checkout/js/view/payment/default", "Magento_OfflinePayments/js/view/payment/method-renderer/checkmo-method", "text!Magento_OfflinePayments/template/payment/checkmo.html", "text!Magento_Checkout/template/billing-address.html", "text!Magento_Checkout/template/payment/before-place-order.html", "text!Magento_Checkout/template/billing-address/details.html", "text!Magento_Checkout/template/billing-address/list.html", "text!Magento_Checkout/template/billing-address/form.html", "text!Magento_CheckoutAgreements/template/checkout/checkout-agreements.html" ], "exclude": [ "bundles/shared" ] }, { "name": "bundles/checkout-cart-index", "create": true, "include": [ "mage/sticky", "Magento_Checkout/js/shopping-cart", "Magento_Checkout/js/discount-codes", "Magento_Checkout/js/proceed-to-checkout", "Magento_Checkout/js/action/update-shopping-cart", "Magento_Dhl/js/model/shipping-rates-validation-rules", "Magento_Dhl/js/model/shipping-rates-validator", "Magento_Fedex/js/model/shipping-rates-validation-rules", "Magento_Fedex/js/model/shipping-rates-validator", "Magento_Ups/js/model/shipping-rates-validation-rules", "Magento_Ups/js/model/shipping-rates-validator", "Magento_GiftMessage/js/model/gift-options", "Magento_GiftMessage/js/model/gift-message", "Magento_OfflineShipping/js/model/shipping-rates-validation-rules/freeshipping", "Magento_OfflineShipping/js/model/shipping-rates-validator/freeshipping", "Magento_Usps/js/model/shipping-rates-validation-rules", "Magento_Usps/js/model/shipping-rates-validator", "Magento_Tax/js/view/checkout/cart/totals/grand-total", "Magento_SalesRule/js/view/cart/totals/discount", "Magento_Tax/js/view/checkout/cart/totals/tax", "Magento_Weee/js/view/cart/totals/weee", "Magento_Tax/js/view/checkout/cart/totals/shipping", "Magento_GiftMessage/js/model/url-builder", "Magento_GiftMessage/js/action/gift-options", "Magento_GiftMessage/js/view/gift-message", "Magento_Dhl/js/view/shipping-rates-validation", "Magento_Fedex/js/view/shipping-rates-validation", "Magento_OfflineShipping/js/view/shipping-rates-validation/freeshipping", "Magento_Ups/js/view/shipping-rates-validation", "Magento_Usps/js/view/shipping-rates-validation", "Magento_Checkout/js/model/cart/cache", "text!Magento_GiftMessage/template/gift-message-item-level.html", "text!Magento_GiftMessage/template/gift-message.html", "Magento_Checkout/js/view/cart/shipping-rates", "Magento_Checkout/js/view/cart/totals", "Magento_Checkout/js/model/cart/totals-processor/default", "Magento_Checkout/js/model/cart/estimate-service", "Magento_Checkout/js/view/cart/shipping-estimation", "text!Magento_Checkout/template/cart/totals.html", "text!Magento_Checkout/template/cart/shipping-rates.html", "text!Magento_SalesRule/template/cart/totals/discount.html", "text!Magento_Tax/template/checkout/cart/totals/shipping.html", "text!Magento_Tax/template/checkout/cart/totals/tax.html", "text!Magento_Tax/template/checkout/cart/totals/grand-total.html", "text!Magento_Checkout/template/cart/shipping-estimation.html" ], "exclude": [ "bundles/shared" ] }, { "name": "bundles/catalog-product-view", "create": true, "include": [ "Magento_Review/js/error-placement", "Magento_Catalog/js/upsell-products", "Magento_Review/js/process-reviews", "Magento_Catalog/js/gallery", "Magento_ProductVideo/js/load-player", "Magento_ProductVideo/js/fotorama-add-video-events", "magnifier/magnifier", "magnifier/magnify", "text!Magento_Theme/templates/breadcrumbs.html", "Magento_Theme/js/model/breadcrumb-list", "Magento_Theme/js/view/breadcrumbs", "Magento_Theme/js/view/add-home-breadcrumb", "Magento_Catalog/js/product/breadcrumbs", "Magento_Review/js/validate-review", "Magento_Catalog/product/view/validation", "Magento_Catalog/js/validate-product", "Magento_Catalog/js/product/view/provider", "text!mage/gallery/gallery.html", "Magento_Review/js/view/review", "text!Magento_InstantPurchase/template/confirmation.html", "Magento_InstantPurchase/js/view/instant-purchase", "fotorama/fotorama", "mage/gallery/gallery", "text!Magento_InstantPurchase/template/instant-purchase.html", "Magento_Downloadable/js/downloadable", "Magento_Catalog/js/related-products", "Magento_Swatches/js/catalog-add-to-cart" ], "exclude": [ "bundles/shared" ] }, { "name": "bundles/catalog-category-view", "create": true, "include": [ "Magento_Catalog/js/product/list/toolbar", "mage/accordion" ], "exclude": [ "bundles/shared" ] } ], "shim": { "jquery/jquery-migrate": { "deps": [ "jquery" ] }, "jquery/jstree/jquery.hotkeys": { "deps": [ "jquery" ] }, "jquery/hover-intent": { "deps": [ "jquery" ] }, "mage/adminhtml/backup": { "deps": [ "prototype" ] }, "mage/captcha": { "deps": [ "prototype" ] }, "mage/common": { "deps": [ "jquery" ] }, "mage/new-gallery": { "deps": [ "jquery" ] }, "mage/webapi": { "deps": [ "jquery" ] }, "jquery/ui": { "deps": [ "jquery" ] }, "MutationObserver": { "deps": [ "es6-collections" ] }, "moment": { "exports": "moment" }, "matchMedia": { "exports": "mediaCheck" }, "jquery/jquery-storageapi": { "deps": [ "jquery/jquery.cookie" ] }, "tiny_mce_4/tinymce.min": { "exports": "tinyMCE" }, "paypalInContextExpressCheckout": { "exports": "paypal" }, "vimeoAPI": {}, "Magento_Tinymce3/tiny_mce/tiny_mce_src": { "exports": "tinymce" }, "magnifier/magnifier": [ "jquery" ], "fotorama/fotorama": [ "jquery" ] }, "paths": { "jquery/ui": "jquery/jquery-ui", "jquery/validate": "jquery/jquery.validate", "jquery/hover-intent": "jquery/jquery.hoverIntent", "jquery/file-uploader": "jquery/fileUploader/jquery.fileupload-fp", "prototype": "legacy-build.min", "jquery/jquery-storageapi": "jquery/jquery.storageapi.min", "text": "requirejs/text", "domReady": "requirejs/domReady", "spectrum": "jquery/spectrum/spectrum", "tinycolor": "jquery/spectrum/tinycolor", "ui/template": "Magento_Ui/templates", "paypalInContextExpressCheckout": "empty:", "temandoCheckoutFieldsDefinition": "Temando_Shipping/js/model/fields-definition", "temandoDeliveryOptions": "Temando_Shipping/js/model/delivery-options", "temandoShippingRatesValidator": "Temando_Shipping/js/model/shipping-rates-validator/temando", "temandoShippingRatesValidationRules": "Temando_Shipping/js/model/shipping-rates-validation-rules/temando" }, "map": { "*": { "rowBuilder": "Magento_Theme/js/row-builder", "toggleAdvanced": "mage/toggle", "translateInline": "mage/translate-inline", "sticky": "mage/sticky", "tabs": "mage/tabs", "zoom": "mage/zoom", "collapsible": "mage/collapsible", "dropdownDialog": "mage/dropdown", "dropdown": "mage/dropdowns", "accordion": "mage/accordion", "loader": "mage/loader", "tooltip": "mage/tooltip", "deletableItem": "mage/deletable-item", "itemTable": "mage/item-table", "fieldsetControls": "mage/fieldset-controls", "fieldsetResetControl": "mage/fieldset-controls", "redirectUrl": "mage/redirect-url", "loaderAjax": "mage/loader", "menu": "mage/menu", "popupWindow": "mage/popup-window", "validation": "mage/validation/validation", "welcome": "Magento_Theme/js/view/welcome", "breadcrumbs": "Magento_Theme/js/view/breadcrumbs", "ko": "knockoutjs/knockout", "knockout": "knockoutjs/knockout", "mageUtils": "mage/utils/main", "rjsResolver": "mage/requirejs/resolver", "checkoutBalance": "Magento_Customer/js/checkout-balance", "address": "Magento_Customer/js/address", "changeEmailPassword": "Magento_Customer/js/change-email-password", "passwordStrengthIndicator": "Magento_Customer/js/password-strength-indicator", "zxcvbn": "Magento_Customer/js/zxcvbn", "addressValidation": "Magento_Customer/js/addressValidation", "quickSearch": "Magento_Search/js/form-mini", "compareList": "Magento_Catalog/js/list", "relatedProducts": "Magento_Catalog/js/related-products", "upsellProducts": "Magento_Catalog/js/upsell-products", "productListToolbarForm": "Magento_Catalog/js/product/list/toolbar", "catalogGallery": "Magento_Catalog/js/gallery", "priceBox": "Magento_Catalog/js/price-box", "priceOptionDate": "Magento_Catalog/js/price-option-date", "priceOptionFile": "Magento_Catalog/js/price-option-file", "priceOptions": "Magento_Catalog/js/price-options", "priceUtils": "Magento_Catalog/js/price-utils", "catalogAddToCart": "Magento_Catalog/js/catalog-add-to-cart", "creditCardType": "Magento_Payment/js/cc-type", "addToCart": "Magento_Msrp/js/msrp", "catalogSearch": "Magento_CatalogSearch/form-mini", "giftMessage": "Magento_Sales/js/gift-message", "ordersReturns": "Magento_Sales/js/orders-returns", "uiElement": "Magento_Ui/js/lib/core/element/element", "uiCollection": "Magento_Ui/js/lib/core/collection", "uiComponent": "Magento_Ui/js/lib/core/collection", "uiClass": "Magento_Ui/js/lib/core/class", "uiEvents": "Magento_Ui/js/lib/core/events", "uiRegistry": "Magento_Ui/js/lib/registry/registry", "consoleLogger": "Magento_Ui/js/lib/logger/console-logger", "uiLayout": "Magento_Ui/js/core/renderer/layout", "buttonAdapter": "Magento_Ui/js/form/button-adapter", "tinymce4": "tiny_mce_4/tinymce.min", "wysiwygAdapter": "mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter", "discountCode": "Magento_Checkout/js/discount-codes", "shoppingCart": "Magento_Checkout/js/shopping-cart", "regionUpdater": "Magento_Checkout/js/region-updater", "sidebar": "Magento_Checkout/js/sidebar", "checkoutLoader": "Magento_Checkout/js/checkout-loader", "checkoutData": "Magento_Checkout/js/checkout-data", "proceedToCheckout": "Magento_Checkout/js/proceed-to-checkout", "downloadable": "Magento_Downloadable/js/downloadable", "configurable": "Magento_ConfigurableProduct/js/configurable", "requireCookie": "Magento_Cookie/js/require-cookie", "cookieNotices": "Magento_Cookie/js/notices", "orderReview": "Magento_Paypal/js/order-review", "paypalCheckout": "Magento_Paypal/js/paypal-checkout", "transparent": "Magento_Payment/js/transparent", "taxToggle": "Magento_Weee/js/tax-toggle", "bundleOption": "Magento_Bundle/bundle", "priceBundle": "Magento_Bundle/js/price-bundle", "slide": "Magento_Bundle/js/slide", "productSummary": "Magento_Bundle/js/product-summary", "giftOptions": "Magento_GiftMessage/js/gift-options", "extraOptions": "Magento_GiftMessage/js/extra-options", "multiShipping": "Magento_Multishipping/js/multi-shipping", "orderOverview": "Magento_Multishipping/js/overview", "payment": "Magento_Multishipping/js/payment", "billingLoader": "Magento_Checkout/js/checkout-loader", "cartUpdate": "Magento_Checkout/js/action/update-shopping-cart", "pageCache": "Magento_PageCache/js/page-cache", "braintree": "empty:", "recentlyViewedProducts": "Magento_Reports/js/recently-viewed", "loadPlayer": "Magento_ProductVideo/js/load-player", "fotoramaVideoEvents": "Magento_ProductVideo/js/fotorama-add-video-events", "captcha": "Magento_Captcha/js/captcha", "wishlist": "Magento_Wishlist/js/wishlist", "addToWishlist": "Magento_Wishlist/js/add-to-wishlist", "wishlistSearch": "Magento_Wishlist/js/search", "tinymceDeprecated": "Magento_Tinymce3/tiny_mce/tiny_mce_src", "editTrigger": "mage/edit-trigger", "addClass": "Magento_Translation/js/add-class", "klarnapi": "empty:", "set-checkout-messages": "Vertex_Tax/js/model/set-checkout-messages" } } }) ```
DrewML commented 5 years ago

Hey Danny! Thanks for the report, and thanks for keeping this deployed to that store so I had time to go look 😄.

It looks like, in your copy of shared.js, jquery/jquery.cookie is getting initialized after jquery.storageapi. jquery.storageapi only sets up $.cookieStorage when $.cookie is present, but the out of order execution is breaking that.

The interesting part of this is that you have the proper shim config in place to prevent this:

"jquery/jquery-storageapi": {
    "deps": [
          "jquery/jquery.cookie"
    ]
}
DrewML commented 5 years ago

Ah, I see what's going on here. This is due to an existing bug in core that we've been hacking in all of the bundling tools.

https://github.com/magento/m2-devtools/blob/56a0165644b41cd620928e6b8b62931e52e734c2/Magento_BundleConfig/view/frontend/requirejs-config.js#L7

I'm not seeing this in your generated requirejs-config.js. Possible an old copy is sitting in static assets on that deployed site?

Januszpl commented 5 years ago

I have this some issue even I had this deps added in my generated requirejs-config.js

DrewML commented 5 years ago

Interesting - any chance either of y'all can deploy somewhere for me to debug? If not, will need help getting a local repro

Januszpl commented 5 years ago

@DrewML I've tested on M2.11.1 with snowdog/sass-blank and my gulp tasks that use requirejs.optimize(config); with Magento_BundleConfig module (from my own repo after changing php restriction from composer)

Requirejs-config.js
(function(require){
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    "waitSeconds": 0,
    "map": {
        "*": {
            "ko": "knockoutjs/knockout",
            "knockout": "knockoutjs/knockout",
            "mageUtils": "mage/utils/main",
            "rjsResolver": "mage/requirejs/resolver"
        }
    },
    "shim": {
        "jquery/jquery-migrate": ["jquery"],
        "jquery/jquery.hashchange": ["jquery", "jquery/jquery-migrate"],
        "jquery/jstree/jquery.hotkeys": ["jquery"],
        "jquery/hover-intent": ["jquery"],
        "mage/adminhtml/backup": ["prototype"],
        "mage/captcha": ["prototype"],
        "mage/common": ["jquery"],
        "mage/new-gallery": ["jquery"],
        "mage/webapi": ["jquery"],
        "jquery/ui": ["jquery"],
        "MutationObserver": ["es6-collections"],
        "tinymce": {
            "exports": "tinymce"
        },
        "moment": {
            "exports": "moment"
        },
        "matchMedia": {
            "exports": "mediaCheck"
        },
        "jquery/jquery-storageapi": {
            "deps": ["jquery/jquery.cookie"]
        }
    },
    "paths": {
        "jquery/validate": "jquery/jquery.validate",
        "jquery/hover-intent": "jquery/jquery.hoverIntent",
        "jquery/file-uploader": "jquery/fileUploader/jquery.fileupload-fp",
        "jquery/jquery.hashchange": "jquery/jquery.ba-hashchange.min",
        "prototype": "legacy-build.min",
        "jquery/jquery-storageapi": "jquery/jquery.storageapi.min",
        "text": "mage/requirejs/text",
        "domReady": "requirejs/domReady",
        "tinymce": "tiny_mce/tiny_mce_src"
    },
    "deps": [
        "jquery/jquery-migrate"
    ],
    "config": {
        "mixins": {
            "jquery/jstree/jquery.jstree": {
                "mage/backend/jstree-mixin": true
            }
        }
    }
};

require(['jquery'], function ($) {
    $.noConflict();
});

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        "*": {
            "rowBuilder":             "Magento_Theme/js/row-builder",
            "toggleAdvanced":         "mage/toggle",
            "translateInline":        "mage/translate-inline",
            "sticky":                 "mage/sticky",
            "tabs":                   "mage/tabs",
            "zoom":                   "mage/zoom",
            "collapsible":            "mage/collapsible",
            "dropdownDialog":         "mage/dropdown",
            "dropdown":               "mage/dropdowns",
            "accordion":              "mage/accordion",
            "loader":                 "mage/loader",
            "tooltip":                "mage/tooltip",
            "deletableItem":          "mage/deletable-item",
            "itemTable":              "mage/item-table",
            "fieldsetControls":       "mage/fieldset-controls",
            "fieldsetResetControl":   "mage/fieldset-controls",
            "redirectUrl":            "mage/redirect-url",
            "loaderAjax":             "mage/loader",
            "menu":                   "mage/menu",
            "popupWindow":            "mage/popup-window",
            "validation":             "mage/validation/validation",
            "welcome":                "Magento_Theme/js/view/welcome"
        }
    },
    paths: {
        "jquery/ui": "jquery/jquery-ui"
    },
    deps: [
        "jquery/jquery.mobile.custom",
        "js/responsive",
        "mage/common",
        "mage/dataPost",
        "js/theme",
        "mage/bootstrap"
    ]
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            checkoutBalance:    'Magento_Customer/js/checkout-balance',
            address:            'Magento_Customer/address',
            changeEmailPassword: 'Magento_Customer/change-email-password',
            passwordStrengthIndicator: 'Magento_Customer/js/password-strength-indicator',
            zxcvbn: 'Magento_Customer/js/zxcvbn'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            compareItems:           'Magento_Catalog/js/compare',
            compareList:            'Magento_Catalog/js/list',
            relatedProducts:        'Magento_Catalog/js/related-products',
            upsellProducts:         'Magento_Catalog/js/upsell-products',
            productListToolbarForm: 'Magento_Catalog/js/product/list/toolbar',
            catalogGallery:         'Magento_Catalog/js/gallery',
            priceBox:               'Magento_Catalog/js/price-box',
            priceOptionDate:        'Magento_Catalog/js/price-option-date',
            priceOptionFile:        'Magento_Catalog/js/price-option-file',
            priceOptions:           'Magento_Catalog/js/price-options',
            priceUtils:             'Magento_Catalog/js/price-utils',
            catalogAddToCart:       'Magento_Catalog/js/catalog-add-to-cart'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            addToCart: 'Magento_Msrp/js/msrp'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            quickSearch: 'Magento_Search/form-mini'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            bundleOption:   'Magento_Bundle/bundle',
            priceBundle:    'Magento_Bundle/js/price-bundle',
            slide:          'Magento_Bundle/js/slide',
            productSummary: 'Magento_Bundle/js/product-summary'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
/*jshint browser:true jquery:true*/
/*global alert*/
var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/action/place-order': {
                'Magento_CheckoutAgreements/js/model/place-order-mixin': true
            },
            'Magento_Checkout/js/action/set-payment-information': {
                'Magento_CheckoutAgreements/js/model/set-payment-information-mixin': true
            }
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            creditCardType: 'Magento_Payment/cc-type'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            downloadable: 'Magento_Downloadable/downloadable'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            catalogSearch: 'Magento_CatalogSearch/form-mini'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            requireCookie: 'Magento_Cookie/js/require-cookie',
            cookieNotices: 'Magento_Cookie/js/notices'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            giftMessage:    'Magento_Sales/gift-message',
            ordersReturns:  'Magento_Sales/orders-returns'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            giftOptions:    'Magento_GiftMessage/gift-options',
            extraOptions:   'Magento_GiftMessage/extra-options'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            discountCode:           'Magento_Checkout/js/discount-codes',
            shoppingCart:           'Magento_Checkout/js/shopping-cart',
            regionUpdater:          'Magento_Checkout/js/region-updater',
            sidebar:                'Magento_Checkout/js/sidebar',
            checkoutLoader:         'Magento_Checkout/js/checkout-loader',
            checkoutData:           'Magento_Checkout/js/checkout-data',
            proceedToCheckout:      'Magento_Checkout/js/proceed-to-checkout'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    paths: {
        'ui/template': 'Magento_Ui/templates'
    },
    map: {
        '*': {
            uiElement:      'Magento_Ui/js/lib/core/element/element',
            uiCollection:   'Magento_Ui/js/lib/core/collection',
            uiComponent:    'Magento_Ui/js/lib/core/collection',
            uiClass:        'Magento_Ui/js/lib/core/class',
            uiEvents:       'Magento_Ui/js/lib/core/events',
            uiRegistry:     'Magento_Ui/js/lib/registry/registry',
            uiLayout:       'Magento_Ui/js/core/renderer/layout',
            buttonAdapter:  'Magento_Ui/js/form/button-adapter'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            configurable: 'Magento_ConfigurableProduct/js/configurable'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            multiShipping: 'Magento_Multishipping/js/multi-shipping',
            orderOverview: 'Magento_Multishipping/js/overview',
            payment: 'Magento_Multishipping/js/payment'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            pageCache:  'Magento_PageCache/js/page-cache'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        "*": {
            "taxToggle": "Magento_Weee/tax-toggle"
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            orderReview:            'Magento_Paypal/order-review',
            paypalCheckout:         'Magento_Paypal/js/paypal-checkout'
        }
    },
    paths: {
        paypalInContextExpressCheckout: 'https://www.paypalobjects.com/api/checkout'
    },
    shim: {
        paypalInContextExpressCheckout: {
            exports: 'paypal'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            transparent:            'Magento_Payment/transparent'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
/*eslint no-unused-vars: 0*/
var config = {
    map: {
        '*': {
            loadPlayer: 'Magento_ProductVideo/js/load-player',
            fotoramaVideoEvents: 'Magento_ProductVideo/js/fotorama-add-video-events'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            captcha: 'Magento_Captcha/captcha'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            recentlyViewedProducts: 'Magento_Reports/js/recently-viewed'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    deps: ['jquery/jquery.cookie']
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            transparent: 'Magento_Payment/transparent'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            editTrigger:   'mage/edit-trigger',
            addClass:      'Magento_Translation/add-class'
        }
    },
    deps: [
        'mage/translate-inline'
    ]
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            braintree: 'https://js.braintreegateway.com/js/braintree-2.25.0.min.js'
        }
    }
};

require.config(config);
})();
(function() {
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            wishlist:       'Magento_Wishlist/wishlist',
            addToWishlist:  'Magento_Wishlist/js/add-to-wishlist',
            wishlistSearch: 'Magento_Wishlist/js/search'
        }
    }
};

require.config(config);
})();

})(require);

Second file

Sass-blank-pro.js build file (with uglify2 or none)
module.exports = {
    // Set "optimize" to "none" to speed up bundling while debugging
    "optimize": "uglify2",
    "generateSourceMaps": true,
    "wrapShim": true,
    "inlineText": true,
    "generateSourceMaps": true,
    "preserveLicenceComments": false,
    "modules": [
        {
            // Modules used on > 1 page(s) of the store
            "name": "bundles/shared",
            "include": [
                "jquery",
                "jquery/jquery.mobile.custom",
                "jquery/jquery.cookie",
                "domReady",
                "mage/smart-keyboard-handler",
                "mage/ie-class-fixer",
                "matchMedia",
                "jquery/jquery-migrate",
                "jquery/jquery-storageapi",
                "underscore",
                "mage/template",
                "mage/apply/scripts",
                "mage/apply/main",
                "mage/mage",
                "mage/translate",
                "knockoutjs/knockout",
                "knockoutjs/knockout-es5",
                "Magento_Ui/js/lib/knockout/extender/observable_array",
                "jquery/ui",
                "mage/dataPost",
                "mage/translate-inline",
                "mage/collapsible",
                "mage/tabs",
                "knockoutjs/knockout-repeat",
                "knockoutjs/knockout-fast-foreach",
                "mage/utils/wrapper",
                "es6-collections",
                "Magento_Ui/js/lib/core/events",
                "Magento_Ui/js/lib/knockout/extender/bound-nodes",
                "Magento_Ui/js/lib/knockout/bindings/mage-init",
                "Magento_Ui/js/lib/knockout/bindings/fadeVisible",
                "Magento_Ui/js/lib/registry/registry",
                "Magento_Ui/js/lib/knockout/template/loader",
                "Magento_Ui/js/lib/knockout/template/renderer",
                "Magento_Ui/js/lib/knockout/bindings/i18n",
                "Magento_Ui/js/lib/knockout/bindings/scope",
                "Magento_Ui/js/lib/knockout/bindings/range",
                "Magento_Ui/js/lib/knockout/bindings/keyboard",
                "Magento_Ui/js/lib/knockout/bindings/after-render",
                "Magento_Ui/js/lib/knockout/bindings/autoselect",
                "Magento_Ui/js/lib/knockout/bindings/outer_click",
                "Magento_Ui/js/lib/knockout/bindings/collapsible",
                "Magento_Ui/js/lib/knockout/bindings/staticChecked",
                "Magento_Ui/js/lib/knockout/bindings/simple-checked",
                "Magento_Ui/js/lib/knockout/bindings/bind-html",
                "jquery/jquery-ui-timepicker-addon",
                "mage/calendar",
                "Magento_Ui/js/lib/knockout/bindings/datepicker",
                "text!ui/template/tooltip/tooltip.html",
                "Magento_Ui/js/lib/knockout/bindings/tooltip",
                "Magento_Ui/js/lib/view/utils/bindings",
                "mage/utils/objects",
                "mage/utils/compare",
                "mage/utils/strings",
                "mage/utils/arrays",
                "mage/utils/template",
                "FormData",
                "mage/utils/misc",
                "mage/utils/main",
                "Magento_Ui/js/lib/knockout/bindings/optgroup",
                "Magento_Ui/js/lib/core/class",
                "Magento_Ui/js/lib/knockout/template/observable_source",
                "Magento_Ui/js/lib/knockout/template/engine",
                "MutationObserver",
                "domReady!",
                "js/responsive",
                "js/theme",
                "mage/common",
                "Magento_Ui/js/lib/view/utils/dom-observer",
                "Magento_Ui/js/lib/view/utils/async",
                "Magento_Ui/js/lib/knockout/bindings/resizable",
                "Magento_Ui/js/lib/knockout/bindings/bootstrap",
                "Magento_Ui/js/lib/knockout/bootstrap",
                "mage/bootstrap",
                "mage/loader",
                "mage/dropdown",
                "Magento_Search/form-mini",
                "mage/menu",
                "mage/cookies",
                "Magento_PageCache/js/page-cache",
                "Magento_Ui/js/block-loader",
                "Magento_Customer/js/section-config",
                "Magento_Ui/js/core/renderer/types",
                "text!ui/template/block-loader.html",
                "Magento_Ui/js/core/renderer/layout",
                "Magento_Ui/js/core/app",
                "mage/url",
                "mage/storage",
                "Magento_Customer/js/customer-data",
                "Magento_Ui/js/lib/core/element/links",
                "Magento_Ui/js/lib/core/storage/local",
                "Magento_Ui/js/lib/core/element/element",
                "Magento_Customer/js/invalidation-processor",
                "jquery/jquery.metadata",
                "jquery/validate",
                "mage/validation",
                "mage/validation/validation",
                "Magento_Ui/js/lib/core/collection",
                "Magento_Catalog/js/view/compare-products",
                "Magento_Tax/js/view/checkout/minicart/subtotal/totals",
                "Magento_Msrp/js/view/checkout/minicart/subtotal/totals",
                "Magento_Catalog/js/view/image",
                "Magento_Customer/js/view/customer",
                "Magento_Wishlist/js/view/wishlist",
                "Magento_Theme/js/view/messages",
                "Magento_Captcha/js/model/captchaList",
                "Magento_Customer/js/invalidation-rules/website-rule",
                "mage/decorate",
                "Magento_Ui/js/lib/spinner",
                "mage/requirejs/resolver",
                "Magento_Ui/js/form/adapter",
                "Magento_Ui/js/form/form",
                "text!ui/template/modal/modal-popup.html",
                "text!ui/template/modal/modal-slide.html",
                "text!ui/template/modal/modal-custom.html",
                "Magento_Ui/js/lib/key-codes",
                "Magento_Ui/js/modal/modal",
                "Magento_Customer/js/model/authentication-popup",
                "Magento_Ui/js/modal/confirm",
                "Magento_Ui/js/modal/alert",
                "Magento_Checkout/js/sidebar",
                "Magento_Checkout/js/view/minicart",
                "Magento_Captcha/js/action/refresh",
                "Magento_Captcha/js/model/captcha",
                "Magento_Captcha/js/view/checkout/defaultCaptcha",
                "Magento_Ui/js/model/messages",
                "Magento_Ui/js/model/messageList",
                "Magento_Ui/js/view/messages",
                "Magento_Customer/js/action/login",
                "Magento_Customer/js/view/authentication-popup",
                "Magento_Captcha/js/view/checkout/loginCaptcha",
                "text!Magento_Checkout/template/minicart/content.html",
                "text!Magento_Customer/template/authentication-popup.html",
                "text!ui/template/collection.html",
                "text!Magento_Ui/template/messages.html",
                "text!Magento_Captcha/template/checkout/captcha.html"
            ],
            "exclude": [],
            "create": true
        },
        {
            "name": "bundles/cms-page-view",
            "create": true,
            "include": [
                "mage/toggle"
            ],
            "exclude": [
                "bundles/shared"
            ]
        }
    ],
    "shim": {
        "jquery/jquery-migrate": {
            "deps": [
                "jquery"
            ]
        },
        "jquery/jquery.hashchange": {
            "deps": [
                "jquery",
                "jquery/jquery-migrate"
            ]
        },
        "jquery/jstree/jquery.hotkeys": {
            "deps": [
                "jquery"
            ]
        },
        "jquery/hover-intent": {
            "deps": [
                "jquery"
            ]
        },
        "mage/adminhtml/backup": {
            "deps": [
                "prototype"
            ]
        },
        "mage/captcha": {
            "deps": [
                "prototype"
            ]
        },
        "mage/common": {
            "deps": [
                "jquery"
            ]
        },
        "mage/new-gallery": {
            "deps": [
                "jquery"
            ]
        },
        "mage/webapi": {
            "deps": [
                "jquery"
            ]
        },
        "jquery/ui": {
            "deps": [
                "jquery"
            ]
        },
        "MutationObserver": {
            "deps": [
                "es6-collections"
            ]
        },
        "tinymce": {
            "exports": "tinymce"
        },
        "moment": {
            "exports": "moment"
        },
        "matchMedia": {
            "exports": "mediaCheck"
        },
        "jquery/jquery-storageapi": {
            "deps": [
                "jquery/jquery.cookie"
            ]
        },
        "paypalInContextExpressCheckout": {
            "exports": "paypal"
        },
        "magnifier/magnifier": [
            "jquery"
        ],
        "fotorama/fotorama": [
            "jquery"
        ]
    },
    "paths": {
        "jquery/validate": "jquery/jquery.validate",
        "jquery/hover-intent": "jquery/jquery.hoverIntent",
        "jquery/file-uploader": "jquery/fileUploader/jquery.fileupload-fp",
        "jquery/jquery.hashchange": "jquery/jquery.ba-hashchange.min",
        "prototype": "legacy-build.min",
        "jquery/jquery-storageapi": "jquery/jquery.storageapi.min",
        "text": "requirejs/text",
        "domReady": "requirejs/domReady",
        "tinymce": "tiny_mce/tiny_mce_src",
        "jquery/ui": "jquery/jquery-ui",
        "ui/template": "Magento_Ui/templates",
        "paypalInContextExpressCheckout": "empty:"
    },
    "map": {
        "*": {
            "ko": "knockoutjs/knockout",
            "knockout": "knockoutjs/knockout",
            "mageUtils": "mage/utils/main",
            "rjsResolver": "mage/requirejs/resolver",
            "rowBuilder": "Magento_Theme/js/row-builder",
            "toggleAdvanced": "mage/toggle",
            "translateInline": "mage/translate-inline",
            "sticky": "mage/sticky",
            "tabs": "mage/tabs",
            "zoom": "mage/zoom",
            "collapsible": "mage/collapsible",
            "dropdownDialog": "mage/dropdown",
            "dropdown": "mage/dropdowns",
            "accordion": "mage/accordion",
            "loader": "mage/loader",
            "tooltip": "mage/tooltip",
            "deletableItem": "mage/deletable-item",
            "itemTable": "mage/item-table",
            "fieldsetControls": "mage/fieldset-controls",
            "fieldsetResetControl": "mage/fieldset-controls",
            "redirectUrl": "mage/redirect-url",
            "loaderAjax": "mage/loader",
            "menu": "mage/menu",
            "popupWindow": "mage/popup-window",
            "validation": "mage/validation/validation",
            "welcome": "Magento_Theme/js/view/welcome",
            "checkoutBalance": "Magento_Customer/js/checkout-balance",
            "address": "Magento_Customer/address",
            "changeEmailPassword": "Magento_Customer/change-email-password",
            "passwordStrengthIndicator": "Magento_Customer/js/password-strength-indicator",
            "zxcvbn": "Magento_Customer/js/zxcvbn",
            "compareItems": "Magento_Catalog/js/compare",
            "compareList": "Magento_Catalog/js/list",
            "relatedProducts": "Magento_Catalog/js/related-products",
            "upsellProducts": "Magento_Catalog/js/upsell-products",
            "productListToolbarForm": "Magento_Catalog/js/product/list/toolbar",
            "catalogGallery": "Magento_Catalog/js/gallery",
            "priceBox": "Magento_Catalog/js/price-box",
            "priceOptionDate": "Magento_Catalog/js/price-option-date",
            "priceOptionFile": "Magento_Catalog/js/price-option-file",
            "priceOptions": "Magento_Catalog/js/price-options",
            "priceUtils": "Magento_Catalog/js/price-utils",
            "catalogAddToCart": "Magento_Catalog/js/catalog-add-to-cart",
            "addToCart": "Magento_Msrp/js/msrp",
            "quickSearch": "Magento_Search/form-mini",
            "bundleOption": "Magento_Bundle/bundle",
            "priceBundle": "Magento_Bundle/js/price-bundle",
            "slide": "Magento_Bundle/js/slide",
            "productSummary": "Magento_Bundle/js/product-summary",
            "creditCardType": "Magento_Payment/cc-type",
            "downloadable": "Magento_Downloadable/downloadable",
            "catalogSearch": "Magento_CatalogSearch/form-mini",
            "requireCookie": "Magento_Cookie/js/require-cookie",
            "cookieNotices": "Magento_Cookie/js/notices",
            "giftMessage": "Magento_Sales/gift-message",
            "ordersReturns": "Magento_Sales/orders-returns",
            "giftOptions": "Magento_GiftMessage/gift-options",
            "extraOptions": "Magento_GiftMessage/extra-options",
            "discountCode": "Magento_Checkout/js/discount-codes",
            "shoppingCart": "Magento_Checkout/js/shopping-cart",
            "regionUpdater": "Magento_Checkout/js/region-updater",
            "sidebar": "Magento_Checkout/js/sidebar",
            "checkoutLoader": "Magento_Checkout/js/checkout-loader",
            "checkoutData": "Magento_Checkout/js/checkout-data",
            "proceedToCheckout": "Magento_Checkout/js/proceed-to-checkout",
            "uiElement": "Magento_Ui/js/lib/core/element/element",
            "uiCollection": "Magento_Ui/js/lib/core/collection",
            "uiComponent": "Magento_Ui/js/lib/core/collection",
            "uiClass": "Magento_Ui/js/lib/core/class",
            "uiEvents": "Magento_Ui/js/lib/core/events",
            "uiRegistry": "Magento_Ui/js/lib/registry/registry",
            "uiLayout": "Magento_Ui/js/core/renderer/layout",
            "buttonAdapter": "Magento_Ui/js/form/button-adapter",
            "configurable": "Magento_ConfigurableProduct/js/configurable",
            "multiShipping": "Magento_Multishipping/js/multi-shipping",
            "orderOverview": "Magento_Multishipping/js/overview",
            "payment": "Magento_Multishipping/js/payment",
            "pageCache": "Magento_PageCache/js/page-cache",
            "taxToggle": "Magento_Weee/tax-toggle",
            "orderReview": "Magento_Paypal/order-review",
            "paypalCheckout": "Magento_Paypal/js/paypal-checkout",
            "transparent": "Magento_Payment/transparent",
            "loadPlayer": "Magento_ProductVideo/js/load-player",
            "fotoramaVideoEvents": "Magento_ProductVideo/js/fotorama-add-video-events",
            "captcha": "Magento_Captcha/captcha",
            "recentlyViewedProducts": "Magento_Reports/js/recently-viewed",
            "editTrigger": "mage/edit-trigger",
            "addClass": "Magento_Translation/add-class",
            "braintree": "empty:",
            "wishlist": "Magento_Wishlist/wishlist",
            "addToWishlist": "Magento_Wishlist/js/add-to-wishlist",
            "wishlistSearch": "Magento_Wishlist/js/search"
        }
    }
};

@dverkade - how is your case? Still facing this issue? (even if making sure having shim with deps for storageapi with jquery.cookie ?)

dverkade commented 5 years ago

Hi @DrewML,

My mistake! I didn't run a setup:static-content:deploy after I installed Magento. Once I did and tested it again it's now working correctly. So I'm closing this issue, since it's not a bug and an error on my side.

Januszpl commented 5 years ago

@dverkade strange... as I still have it even after running setup:static-content:deploy..

DrewML commented 5 years ago

@Januszpl looking at your config, seems like things should be working. If you can't deploy to a publicly accessible store, maybe we can hop on a call and look at it?

Januszpl commented 5 years ago

@DrewML sure. It seems when I use Magento_BundleConfig to load bundles it show those errors even if in shared.js I have

!function(e){"function"==typeof define&&define.amd?define('jquery/jquery-storageapi',["jquery"],e)

if I add bundles by adding to the end of requirejs-config.js

require.config({
              bundles: {"bundles/shared":["requirejs/domReady","mage/ie-class-fixer","underscore","mage/template","matchMedia","jquery","jquery/jquery.mobile.custom","jquery/jquery.cookie","mage/smart-keyboard-handler","mage/apply/scripts","mage/apply/main","mage/mage","mage/translate","jquery/jquery-migrate","jquery/jquery.storageapi.min","mage/utils/wrapper","es6-collections","knockoutjs/knockout","knockoutjs/knockout-es5","Magento_Ui/js/lib/knockout/extender/observable_array","knockoutjs/knockout-fast-foreach","Magento_Ui/js/lib/core/events","Magento_Ui/js/lib/knockout/extender/bound-nodes","knockoutjs/knockout-repeat","Magento_Ui/js/lib/knockout/bindings/mage-init","Magento_Ui/js/lib/knockout/bindings/fadeVisible","Magento_Ui/js/lib/registry/registry","Magento_Ui/js/lib/knockout/template/loader","Magento_Ui/js/lib/knockout/template/renderer","Magento_Ui/js/lib/knockout/bindings/i18n","Magento_Ui/js/lib/knockout/bindings/scope","Magento_Ui/js/lib/knockout/bindings/keyboard","Magento_Ui/js/lib/knockout/bindings/after-render","Magento_Ui/js/lib/knockout/bindings/autoselect","Magento_Ui/js/lib/knockout/bindings/outer_click","Magento_Ui/js/lib/knockout/bindings/collapsible","Magento_Ui/js/lib/knockout/bindings/staticChecked","Magento_Ui/js/lib/knockout/bindings/simple-checked","Magento_Ui/js/lib/knockout/bindings/bind-html","requirejs/text","text!ui/template/tooltip/tooltip.html","Magento_Ui/js/lib/knockout/bindings/tooltip","Magento_Ui/js/lib/view/utils/bindings","mage/utils/objects","mage/utils/compare","mage/utils/strings","mage/utils/arrays","mage/utils/template","jquery/jquery-ui","mage/dataPost","mage/translate-inline","mage/collapsible","mage/tabs","Magento_Ui/js/lib/knockout/bindings/range","jquery/jquery-ui-timepicker-addon","mage/calendar","Magento_Ui/js/lib/knockout/bindings/datepicker","FormData","mage/utils/misc","mage/utils/main","Magento_Ui/js/lib/knockout/bindings/optgroup","Magento_Ui/js/lib/core/class","Magento_Ui/js/lib/knockout/template/observable_source","Magento_Ui/js/lib/knockout/template/engine","MutationObserver","domReady!","js/responsive","js/theme","mage/common","Magento_Ui/js/lib/view/utils/dom-observer","Magento_Ui/js/lib/view/utils/async","Magento_Ui/js/lib/knockout/bindings/resizable","Magento_Ui/js/lib/knockout/bindings/bootstrap","Magento_Ui/js/lib/knockout/bootstrap","mage/bootstrap","mage/loader","mage/dropdown","Magento_Search/form-mini","mage/menu","mage/cookies","Magento_PageCache/js/page-cache","Magento_Ui/js/block-loader","Magento_Customer/js/section-config","text!ui/template/block-loader.html","Magento_Ui/js/core/renderer/types","Magento_Ui/js/core/renderer/layout","Magento_Ui/js/core/app","mage/url","mage/storage","Magento_Customer/js/customer-data","Magento_Ui/js/lib/core/element/links","Magento_Ui/js/lib/core/storage/local","Magento_Ui/js/lib/core/element/element","Magento_Customer/js/invalidation-processor","Magento_Ui/js/lib/core/collection","Magento_Catalog/js/view/compare-products","Magento_Tax/js/view/checkout/minicart/subtotal/totals","Magento_Msrp/js/view/checkout/minicart/subtotal/totals","Magento_Catalog/js/view/image","Magento_Customer/js/view/customer","Magento_Wishlist/js/view/wishlist","Magento_Theme/js/view/messages","jquery/jquery.metadata","jquery/jquery.validate","mage/validation","mage/validation/validation","Magento_Captcha/js/model/captchaList","Magento_Customer/js/invalidation-rules/website-rule","mage/decorate","Magento_Ui/js/lib/spinner","mage/requirejs/resolver","Magento_Ui/js/form/adapter","Magento_Ui/js/form/form","text!ui/template/modal/modal-popup.html","text!ui/template/modal/modal-slide.html","text!ui/template/modal/modal-custom.html","Magento_Ui/js/lib/key-codes","Magento_Ui/js/modal/modal","Magento_Customer/js/model/authentication-popup","Magento_Ui/js/modal/confirm","Magento_Ui/js/modal/alert","Magento_Checkout/js/sidebar","Magento_Checkout/js/view/minicart","Magento_Captcha/js/action/refresh","Magento_Captcha/js/model/captcha","Magento_Captcha/js/view/checkout/defaultCaptcha","Magento_Ui/js/model/messages","Magento_Ui/js/model/messageList","Magento_Ui/js/view/messages","Magento_Customer/js/action/login","Magento_Customer/js/view/authentication-popup","Magento_Captcha/js/view/checkout/loginCaptcha","text!Magento_Checkout/template/minicart/content.html","text!Magento_Customer/template/authentication-popup.html","text!ui/template/collection.html","text!Magento_Ui/template/messages.html","text!Magento_Captcha/template/checkout/captcha.html","Magento_Catalog/js/price-utils","jquery/jquery.parsequery","Magento_Swatches/js/swatch-renderer","Magento_Wishlist/js/add-to-wishlist","Magento_Cookie/js/require-cookie","Magento_Catalog/js/catalog-add-to-cart"]},
            });require.config({
              bundles: {"bundles/cms-page-view":["mage/toggle"]},
            });require.config({
              bundles: {"bundles/catalog-product-view":["Magento_ConfigurableProduct/js/options-updater","Magento_Catalog/js/price-box","Magento_Review/js/error-placement","Magento_Review/js/process-reviews","magnifier/magnifier","magnifier/magnify","Magento_Catalog/js/gallery","Magento_ProductVideo/js/load-player","Magento_ProductVideo/js/fotorama-add-video-events","Magento_Review/js/view/review","text!mage/gallery/gallery.html","Magento_Catalog/product/view/validation","Magento_Catalog/js/validate-product","fotorama/fotorama","mage/gallery/gallery"]},
            });require.config({
              bundles: {"bundles/catalog-category-view":["Magento_Swatches/js/catalog-add-to-cart","Magento_Catalog/js/product/list/toolbar","Magento_Catalog/js/compare"]},
            });

It load async shared.js and then missing storageapi.min.js

!function(e) {
    "function" == typeof define && define.amd ? define(["jquery"], e) : e("object" == typeof exports ? require("jquery") : jQuery)
}(function(e) {
Januszpl commented 5 years ago

Adding jquery.cookie to jquery-migrate resolved my issues:

"shim": {
        "jquery/jquery-migrate": {
            "deps": [
                "jquery",
                "jquery/jquery.cookie"
            ]
        },

However will check few things on M2.1.11 and m2.3 with luma and blank

DrewML commented 5 years ago

Adding jquery.cookie to jquery-migrate resolved my issues:

Interesting. The current dependency graph is a bit of a nightmare. Hopefully we can clean that up a bit 😅

dverkade commented 5 years ago

Hi @DrewML, @Januszpl,

I did some further digging into this issue. My issue was resolved on Magento 2.3.0, however when we did the same in Magento 2.2.6 the same error occurred. This was fixed with added jquery.cookie to jquery-migrate as demonstrated by @Januszpl. Let me know if you need more info for this issue.

DrewML commented 5 years ago

Thanks @dverkade! I'll setup a 2.2.6 store and see if I can replicate and try to get a fix in.

dverkade commented 5 years ago

Tested this on Magento 2.2.7 and still the same issue. This was again fixed with adding jquery.cookie to jquery-migrate as demonstrated by @Januszpl.

piotrekkaminski commented 5 years ago

ref MC-18605

DrewML commented 5 years ago

For anyone interested, I had to look into this for the new bundler, and found the root cause.

In Magento core, the following shim config is present (as mentioned):

'jquery/jquery-storageapi': {
   'deps': ['jquery/jquery.cookie']
}

But, jquery/jquery-storageapi is already an AMD module - shims are meant for non-AMD modules. From the RequireJS docs:

image

So this is a bug we need to fix in Magento core by adding an explicit dependency of jquery/jquery.cookie in jquery/jquery-storageapi - @adifucan is working on getting this fix landed in core

adifucan commented 5 years ago

Fixed in https://github.com/magento/magento2/commit/db43c11c6830465b764ede32abb7262258e5f574