-
Couldn't load subscription status.
- Fork 9.4k
Closed
Labels
Issue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed
Description
Preconditions
- Magento 2.2.x
- Mysql Ver 15.1 Distrib 10.2.15-MariaDB, for Linux (x86_64) using readline 5.1
- PHP 7.0.30
- RequireJS 2.1.11
Steps to reproduce
- Create a javascript file that requires the colorpicker used in the core (under the product attribute Visual Swatch in the admin panel)
// Vendor_Module/js/this/custom/file
require([
'jquery',
'jquery/colorpicker/js/colorpicker',
], function ($) {
'use strict';
// do anything, the damage is done
console.log("required the colorpicker. Be free!");
Expected result
- Should see a message in the console that says "required the colorpicker. Be free!"
- Can then customise the colorpicker as you would please.
Actual result
- Console error "Uncaught Error: Mismatched anonymous define() module" talking about the colorpicker.
To solve it, simply add any random string ID to the definition of the colorpicker.
Example
// lib/web/jquery/colorpicker/js/colorpicker.js:10
define("mage/colorpicker", [
"jquery",
], function ($) {
A quick workaround is to simply repackage the colorpicker into the module/theme you want to use, with it patched as described, but it would be awesome to have this patched in the core, with the correct naming convention etc.
Please let me know if any more details are required.
Metadata
Metadata
Assignees
Labels
Issue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed