0

I am currently using Magento 2.2.2 and all is fine with JS bundling and minifying off.

However, when I enable js bundling I get a JavaScript error. I think this is related to a require.js config file. This error only appears when bundling.

When inspecting the compiled js file I notice there is an empty js build component. Where is this built from and what steps should I go about resolving this?

If I remove the empty js build manually from the compiled js file, there are no problems.

Navin Bhudiya
3,0189 gold badges41 silver badges72 bronze badges
asked Feb 13, 2018 at 0:48
2
  • Did you find an answer to this problem? I am facing the same issue. Commented Aug 6, 2019 at 8:13
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review Commented Aug 6, 2019 at 8:48

1 Answer 1

0

In my case it was caused by a utf8_encode error on a copyright-character in requirejs-config.js in the Mageplaza/Core module.

When Magento creates the bundle files it uses json_encode($contents, JSON_UNESCAPED_SLASHES) to create the json string for the bundle. When this fails, it returns an empty string without showing any errors.

answered Aug 14, 2019 at 10:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.