Closed dverkade closed 5 years ago
Thanks Danny! Would you be able to deploy this broken build to somewhere publicly-accessible like in #44? Would make it a bit quicker to debug.
Without running the code, I was able to spot at least 1 of the issues from the screenshot.
The Amazon_Payments
module is loading uiRegistry
using a synchronous require
call:
var registry = require('uiRegistry');
if (registry.get('amazonPayment') !== undefined) {
var amazonPayment = registry.get('amazonPayment');
define([amazonPayment.widgetUrl], function () {
'use strict';
//after amazon widgets file as loaded
});
}
Because of the sync usage of require
, that module is going to blow up anytime its code executes before the code of the module that it is obtaining with require('dependency')
.
I logged a bug with the Amazon module: https://github.com/amzn/amazon-payments-magento-2-plugin/issues/405
We should be able to hack around this for the time being without an upstream fix, though. Let me know if you have some time to chat it out on Slack.
@DrewML thanks! Not really a bug in Magento but of this 3rd party integration of Amazon.
As a workaround I removed all Amazon references from my build.js file, which resolves this issue.
As a workaround I removed all Amazon references from my build.js file, which resolves this issue.
ah yeah, that works too! I'm going to leave this issue open until it's resolved in the Amazon Payments module, so others with the problem can find this easily. I might just bake in a config fix for Amazon Payments until then 🤔
This was fixed in the upstream module https://github.com/amzn/amazon-payments-magento-2-plugin/pull/410
This issue is a:
Environment
node -v
)npm -v
)Description
With the Amazon modules enabled (Amazon_Payments, Amazon_Login & Amazon_Core) the bundled javascript throws an error. This can be fixed by disabling the Amazon modules in Magento and removing any the entries in the build.js file referencing Amazon.
Expected result:
Javascript bundeling should work correctly with Amazon modules enabled.
Screenshots
This is the first error thrown:
This will result and the following additional errors:
Once the Amazon modules are disabled first error is gone. Additional errors are also gone.