netresearch / dhl-module-ui

Module for providing the presentation layer within the Magento application for custom functionality
Open Software License 3.0
3 stars 0 forks source link

Uncaught TypeError: $.initNamespaceStorage is not a function #4

Closed HenKun closed 3 years ago

HenKun commented 3 years ago

When using JS bundling techniques, the error

Uncaught TypeError: $.initNamespaceStorage is not a function

might occur, which refers to line 7 in vendor/dhl/module-ui/view/frontend/web/js/model/checkout/storage.js:

var t = $.initNamespaceStorage("dhl_shipping_data_storage").localStorage

This is because jquery/jquery-storageapi might not have been loaded already. To fix the issue, vendor/dhl/module-ui/view/frontend/web/js/model/checkout/storage.js needs to require jquery/jquery-storageapi in its define like:

define([
    'jquery',
    'Magento_Checkout/js/model/quote',
    'jquery/jquery-storageapi'
], function ($, quote) {
mam08ixo commented 3 years ago

Fix will be included with the next release, thank you for the contribution!

ngolatka commented 3 years ago

Internal ref: DHLGW-1005

mam08ixo commented 3 years ago

Fix released with version 1.2.1