Today when deploying our code base we've run into the following error:

lwc/orderGrid/orderGrid.js-meta.xml -- Error: Failed to save Lightning Component Resource 
[lwc/orderGrid/orderGrid.js] of Lightning Component Bundle [orderGrid]. 
Error: Value too long for field: Source maximum length is:131072

Looking at the size of file in question it is really bigger than 131,072 bytes. But we cannot find in documentation anything regarding limit for js file as a part of lwc component.

Can anyone point us in the right direction? Is it a real restriction or just some SF bug?

  • 1
    Are you using any rich text or long text field in your code? – sanket kumar Oct 28 '19 at 10:03
  • @sanketkumar Yes, we are using bunch of such fields, but error is not because of them. 'Source' field mentioned in error message refers to internal SF object which is used to hold lwc code, similar to ApexClass etc. When we removed ~50 lines of code to decrease size of js file below mentioned max, it has been deployed successfully. So, definitely size limit problem, just not documented. – wesaw Oct 28 '19 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.