Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.2.2 /checkout JS Components will not be loaded. #12679

Closed
aKalisch opened this issue Dec 13, 2017 · 30 comments
Closed

Magento 2.2.2 /checkout JS Components will not be loaded. #12679

aKalisch opened this issue Dec 13, 2017 · 30 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@aKalisch
Copy link

After I updated from Magento 2.2.1 to 2.2.2 my checkout is not working any longer. This might be only caused when a Virtual Item is placed in Cart.

Preconditions

  1. Magento 2.2.2 (Only virtual items purchasable)
  2. PHP 7.0.12
  3. MacOS with laravel valet enviroment (Nginx / SSL on)

Steps to reproduce

  1. Put a virtual item into cart
  2. proceed to checkout

Expected result

  1. The Checkout page loads so the Payment methods apear

Actual result

bildschirmfoto 2017-12-13 um 17 06 18

bildschirmfoto 2017-12-13 um 17 06 44

JQMIGRATE: Logging is active [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_Checkout/js/view/summary" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_Tax/js/view/checkout/summary/grand-total" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_Checkout/js/view/summary/cart-items" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_Tax/js/view/checkout/summary/tax" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_SalesRule/js/view/payment/discount" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_Tax/js/view/checkout/summary/subtotal" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_Checkout/js/view/summary/totals" component. [2017-12-13 04:53:25] [ERROR] Failed to load the "Magento_SalesRule/js/view/summary/discount" component. [2017-12-13 04:53:35] [ERROR] Failed to load the "Magento_Checkout/js/view/estimation" component.

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Dec 13, 2017
@magento-engcom-team
Copy link
Contributor

@aKalisch , thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation.

@KoenSlagter
Copy link

I'm having the same problem with a configurable product

@magento-engcom-team
Copy link
Contributor

@KoenSlagter ,We were not able to reproduce this issue for configurable product too . Please provide more detailed steps to reproduce or try to reproduce this issue on vanilla instaliation without any extentions if you have, thank you.

@magento-engcom-team
Copy link
Contributor

@aKalisch, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@vicefi
Copy link

vicefi commented Dec 27, 2017

I have the same issue while load different pages in admin panel. The names of components are different too. Problen on Windows hosted server

@PieterCappelle
Copy link
Contributor

PieterCappelle commented Jan 24, 2018

Having same issue. Strange! Any ideas? Did you use the Netresearch_OPS module?

@VincentMarmiesse
Copy link
Contributor

VincentMarmiesse commented Feb 1, 2018

Same issue on the cart page.
capture d ecran de 2018-02-01 01-38-56

I have a configurable product in my cart.

EDIT: ok after some investigation, this error was caused in my case because the block checkout.cart.shipping had been removed from the checkout_cart_index handle.

@webstower
Copy link

Same problem after user inline translate and then run a few commands from console... The same errors in the RESUME in cart view.. Somebody who can help me?

@simonmaass
Copy link

simonmaass commented Mar 8, 2018

image

I am having the same problem... magento 2.2.3

@kesarweb
Copy link

kesarweb commented Mar 21, 2018

+1 exactly the same.
Server: CentOS 7 PHP 7.0.28 MySQL 5.6 PHP-FPM nginx.
I also tried on Windows XAMPP and having exactly the same issue.

Anyone had a chance to figure this out?

UPDATE I've had JS variable in checkout template that was not supposed to be concatenated as a string.

@simonmaass I see from your screenshot before all component failures you have 'Unexpected token' error which seems to be JS error which may be impacting checkout. Just a food for thought.

Thanks!
Anton

@alvarolrsantos
Copy link

did anyone find the solution? I am stuck here with the same error! =(

@Waldemar-Denke
Copy link

Please try to disable js bundle. Figured out that, in dev mode bundling works, or seems to. But if you activate production mode and deploy static content, it breaks the checkout.

@arnoldmontiel
Copy link

Same problem here with 2.2.4 at /checkout/cart
Also the actual checkout page does not work but with no error logging.

PHP 7.0.30-1+ubuntu16.04.1
Apache/2.4.18 (Ubuntu)

Could Anyone fix it?

image

@magnetic5355
Copy link

+1

@rav-redchamps
Copy link
Contributor

@arnoldmontiel

In our case, this was getting caused by issue #14950

Please see my comment on the link. It should fix the problem.

@thanhdble
Copy link

+1 when upgrade version

@dvcm
Copy link

dvcm commented Jul 10, 2018

Magento Version 2.2.5
PHP: 5.6.30
libmysql - 5.1.73
Version server: 5.6.32-78.1

why does the path add this? resource =

and why does the system exchange the script by file?

https://ilubrasileiro.com.br/pub/static/frontend/Magento/luma/pt_BR/Magento_Tax/js/view/checkout/cart/totals/tax.js/?resource=frontend/Magento/luma/pt_BR/Magento_Tax/js/view/checkout/cart/totals/tax.js

screen shot 2018-07-10 at 07 24 09

screen shot 2018-07-10 at 07 20 35

@zeeshan2523806
Copy link

This is because there might be some javascript errors on your page, try clearing the cache and regenrate the static content if you are running in production mode. If the error still persist then look at the file which might be causing the problem.

@jalogut
Copy link
Contributor

jalogut commented Sep 4, 2018

In case that it helps someone, the problem is the annoying Test modules that Magento creates out of nowhere when running integration tests. If you have these modules enabled in production mode, the checkout does not work anymore.

Disabling or removing such module from config.php solves the issue.

<?php
return [
    'modules' => [
        //...
        'Magento_TestModuleDirectoryZipCodes' => 0,
        'Magento_TestModuleFakePaymentMethod' => 0,
        'Magento_TestModuleSample' => 0,
        //
    ]
]

@Ctucker9233
Copy link

@magento-engcom-team Please reinvestigate.

@Ctucker9233 Ctucker9233 reopened this Nov 12, 2018
@ghost
Copy link

ghost commented Nov 15, 2018

Hi @Ctucker9233 this will be fixed by this PR -> #18459 and this issue is duplicate to this -> #12696

@ghost ghost closed this as completed Nov 15, 2018
@Rafiqul-Islam-Rafiq
Copy link

error

I am having the same problem after upgrading to magento 2.2.7

@AndyJAllen
Copy link

I was having this issue after upgrading from 2.2.6 to 2.3.1 and I eventually got it to go away. I'm not sure exactly what I did to resolve it but I'll share each step I took.

  1. Remove the child folders in App/Code/Magento then run the upgrade/compile/deploy commands.
  • TestModuleDirectoryZipCodes

  • TestModuleFakePaymentMethod

  • TestModuleSample

  1. Verify the ownership permissions for files in var/cache, ./generated, and pub/static. In my test environment hosted on Ubuntu some files/folders don't get created with the correct ownership information. I have to run the command multiple times as the site is building the cache and static files.

  2. Replace Serializer/Json.php (as I seem to have to do in every Magento upgrade....)

@ryans1224
Copy link

I had the same problem, and in my case, it was caused by an incorrect crypt key set in env.php

@elvinristi
Copy link
Contributor

elvinristi commented Jan 30, 2020

Usually it means that in your customized project checkout.cart.shipping crashed on something and therefor it wasn't returning Magento_Checkout::cart/shipping.phtml content which initilizes window.checkoutConfig javascript object.

As all those components or their sub-components (mentioned on reporter's screenshot) require Magento_Checkout/js/model/quote then initialising this fails due hardcoded data assign from window.checkoutConfig.*, like

        quoteData = window.checkoutConfig.quoteData,
        basePriceFormat = window.checkoutConfig.basePriceFormat,
        priceFormat = window.checkoutConfig.priceFormat,

For me gave hint local Development mode which didn't hide sub-block crash and I was able to track down the real root cause.

For me one custom checkout's CompositeConfigProvider was throwing Exception due sql error but it was hidden in Production mode.

@abelbmx
Copy link

abelbmx commented Mar 24, 2020

Same issue on the cart page.
capture d ecran de 2018-02-01 01-38-56

I have a configurable product in my cart.

EDIT: ok after some investigation, this error was caused in my case because the block checkout.cart.shipping had been removed from the checkout_cart_index handle.

Where can I find those files to modify them?

@drinkingsouls
Copy link

I am having the same issue on Magento 2.3.4.
Was there a fix for this?

@drinkingsouls
Copy link

Thought I'd follow this up for anyone looking for solutions.
For some reason my vendor/magento/module-tax/view/frontend/web/js/view/checkout was empty. I restored the files from a backup.
Ran composer update after.

@harrigo
Copy link

harrigo commented Feb 2, 2021

For me this was similar to everyone with configurable products breaking the window.checkoutConfig json giving an unexpected token error. This was called in the shipping template as mentioned and uses the getSerializedCheckoutConfig function from Magento\Checkout\Block\Cart\Shipping class.

shipping.phtml
window.checkoutConfig = <?= /* @escapeNotVerified */ $block->getSerializedCheckoutConfig() ?>;

The configuration seemed to pull some encoded html that had some problem characters in the case of a configurable product and found that rewriting the function within the Shipping.php file like below fixed the issue:

replace:
return json_encode($this->getCheckoutConfig(), JSON_HEX_TAG);

with:
return json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);

@realadityayadav
Copy link
Member

if some one is using Klarna and Magento version 2.4.3 then you should disable Request Logging in Klarna to get hold of this error
#34634 (comment)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests