Wrong meta data file content when creating lightning web component

Issue #1230 resolved
Loeng Chen created an issue

When creating a new lightning web component through the ui, then a meta data file is created with the correct file name. However the content of the meta data file is not correct. The content of the meta data states that a StaticResource is created:

<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
    <cacheControl></cacheControl>
    <contentType></contentType>
    <description>myComponent</description>
</StaticResource>

This is not correct. It should be a LightingComponentBundle

Reproduction Steps

In the Project Folder Pane, Right-click, Select New Lightning Web Component

1.png

Dialog opens. Fill in the necessary information. E.g. name: myComponent Tag name: myComponet ClassName: MyComponent

Click on OK.

3 Files will be created: myComponent.html myComponent.js myComponent.js-meta.xml

Open XML file

The content of the XML will show:

<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
    <cacheControl></cacheControl>
    <contentType></contentType>
    <description>myComponent</description>
</StaticResource>

I would expect the following content:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="myComponent">
    <apiVersion>45.0</apiVersion>
    <isExposed>false</isExposed>

</LightningComponentBundle>

Comments (18)

  1. Scott Wells repo owner

    Another user reported this the other day here:

    https://groups.google.com/a/illuminatedcloud.com/d/msgid/discussion/abb61197-be83-46fb-b423-bbcba8329487%40illuminatedcloud.com

    I haven't been able to reproduce it, but I have implemented a few fixes for the next build that might help, and I've also instrumented the meta.xml file creation logic very heavily with debug logging in case it's not addressed. I'll post the new build tomorrow and hopefully one of you that is having this issue can see if it fixes the issue or provide debug logs if not. Thanks for reporting!

  2. Scott Wells repo owner

    I've just uploaded 2.0.5.3. This issue might be fixed by the changes in that build, but if not, please add the following to Help>Debug Log Settings, reproduce the issue, and provide the resulting idea.log:

    #com.illuminatedcloud.intellij.filetype.IlluminatedCloudFileTemplateUtil
    

    That should show exactly how the metadata type is being inferred for the meta.xml file. Thanks!

  3. Adam Marchbanks

    Hello Scott,

    I'm also experiencing this issue. Looking through the debug log generated I do not see anything out of the ordinary apart from indications that the deployment failed due to the wrong XML being present.

    2019-02-05 20:09:13,667 [ 304783]   INFO - ontentsSynchronizationListener - The metadata subscription for module 'Spring 19 Pre-release' was updated:
    
    LightningComponentBundle
    • switchtemplate [ADD]
    
    2019-02-05 20:09:18,159 [ 309275]   INFO - er.ForceComMetadataApiDeployer - Deployment status = FAILED 
    2019-02-05 20:09:18,160 [ 309276]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/switchtemplate/switchtemplate.js-meta.xml: Cannot find Lightning Component Bundle switchtemplate. 
    2019-02-05 20:09:18,164 [ 309280]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate/switchtemplate.js-meta.xml 
    2019-02-05 20:09:18,182 [ 309298]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:09:20,177 [ 311293]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    2019-02-05 20:09:20,177 [ 311293]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/switchtemplate/switchtemplate.js-meta.xml: Error parsing file: LWC Metadata Xml Parser: Unhandled XML element: StaticResource 
    2019-02-05 20:09:20,177 [ 311293]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate/switchtemplate.js-meta.xml 
    2019-02-05 20:09:20,178 [ 311294]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/switchtemplate/switchtemplate.js: XML parse error: Unhandled XML element: StaticResource 
    2019-02-05 20:09:20,178 [ 311294]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate/switchtemplate.js 
    2019-02-05 20:09:20,191 [ 311307]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:09:22,589 [ 313705]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    2019-02-05 20:09:22,590 [ 313706]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/switchtemplate/switchtemplate.js-meta.xml: Error parsing file: LWC Metadata Xml Parser: Unhandled XML element: StaticResource 
    2019-02-05 20:09:22,590 [ 313706]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate/switchtemplate.js-meta.xml 
    2019-02-05 20:09:22,590 [ 313706]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/switchtemplate/switchtemplate.js: XML parse error: Unhandled XML element: StaticResource 
    2019-02-05 20:09:22,590 [ 313706]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate/switchtemplate.js 
    2019-02-05 20:09:22,595 [ 313711]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:09:22,598 [ 313714]   WARN - .IlluminatedCloudExceptionUtil - getInputStream() must not be called against a directory: file://C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate 
    java.io.IOException: getInputStream() must not be called against a directory: file://C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/switchtemplate
        at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.getInputStream(VirtualDirectoryImpl.java:676)
        at com.illuminatedcloud.intellij.builder.ForceComBuilderUtil.getFileContentsAsByteArray(ForceComBuilderUtil.java:1066)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.createDeploymentArchive(ForceComMetadataApiDeployer.java:660)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:265)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer$1.run(ForceComMetadataApiDeployer.java:192)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
        at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
        at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    2019-02-05 20:09:36,635 [ 327751]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:09:39,255 [ 330371]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    

    And this is the metadata XML file which was generated:

    <?xml version="1.0" encoding="UTF-8"?>
    <StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
        <cacheControl></cacheControl>
        <contentType></contentType>
        <description>switchtemplate</description>
    </StaticResource>
    

    Just updated to 2.0.5.3.

    Regards, Adam

  4. Scott Wells repo owner

    Thanks, Adam. Just to clarify, this is happening to you on today's build, correct? If so, can you follow the instructions from the second comment back to get debug logging from the actual component creation and not its deployment? I'll be looking for debug log rows for IlluminatedCloudFileTemplateUtil in particular.

  5. Adam Marchbanks

    Same result, and yes on todays build. This is my complete log, I emptied it out before running any actions:

    2019-02-05 20:37:44,712 [2015828]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:37:44,723 [2015839]   INFO - ontentsSynchronizationListener - The metadata subscription for module 'Spring 19 Pre-release' was updated:
    
    LightningComponentBundle
     debugtest [ADD]
    
    2019-02-05 20:37:49,133 [2020249]   INFO - er.ForceComMetadataApiDeployer - Deployment status = FAILED 
    2019-02-05 20:37:49,133 [2020249]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest/debugtest.js-meta.xml: Cannot find Lightning Component Bundle debugtest. 
    2019-02-05 20:37:49,134 [2020250]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest/debugtest.js-meta.xml 
    2019-02-05 20:37:49,141 [2020257]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:37:51,125 [2022241]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    2019-02-05 20:37:51,125 [2022241]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest/debugtest.js-meta.xml: Error parsing file: LWC Metadata Xml Parser: Unhandled XML element: StaticResource 
    2019-02-05 20:37:51,125 [2022241]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest/debugtest.js-meta.xml 
    2019-02-05 20:37:51,125 [2022241]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest/debugtest.js: XML parse error: Unhandled XML element: StaticResource 
    2019-02-05 20:37:51,144 [2022260]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest/debugtest.js 
    2019-02-05 20:37:51,150 [2022266]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:37:53,408 [2024524]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    2019-02-05 20:37:53,409 [2024525]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest/debugtest.js-meta.xml: Error parsing file: LWC Metadata Xml Parser: Unhandled XML element: StaticResource 
    2019-02-05 20:37:53,409 [2024525]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest/debugtest.js-meta.xml 
    2019-02-05 20:37:53,409 [2024525]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest/debugtest.js: XML parse error: Unhandled XML element: StaticResource 
    2019-02-05 20:37:53,409 [2024525]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest/debugtest.js 
    2019-02-05 20:37:53,411 [2024527]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:37:53,412 [2024528]   WARN - .IlluminatedCloudExceptionUtil - getInputStream() must not be called against a directory: file://C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest 
    java.io.IOException: getInputStream() must not be called against a directory: file://C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest
        at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.getInputStream(VirtualDirectoryImpl.java:676)
        at com.illuminatedcloud.intellij.builder.ForceComBuilderUtil.getFileContentsAsByteArray(ForceComBuilderUtil.java:1066)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.createDeploymentArchive(ForceComMetadataApiDeployer.java:660)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:265)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer$1.run(ForceComMetadataApiDeployer.java:192)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
        at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
        at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    2019-02-05 20:38:15,567 [2046683]   INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: #com.illuminatedcloud.intellij.filetype.IlluminatedCloudFileTemplateUtil 
    2019-02-05 20:38:22,209 [2053325]  DEBUG - luminatedCloudFileTemplateUtil - Trying to determine the metadata type for file debugtest2.js in directory debugtest2. 
    2019-02-05 20:38:22,209 [2053325]  DEBUG - luminatedCloudFileTemplateUtil -   The file extension is js. 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil -   The metadata class for that file extension is unknown. 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil -   The JavaScript file extension is . 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil -   Unable to determine the metadata class. Defaulting to StaticResource. 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil - Setting METADATA_TYPE to StaticResource for file debugtest2.js in directory debugtest2. 
    2019-02-05 20:38:22,536 [2053652]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:38:22,546 [2053662]   INFO - ontentsSynchronizationListener - The metadata subscription for module 'Spring 19 Pre-release' was updated:
    
    LightningComponentBundle
     debugtest2 [ADD]
    
    2019-02-05 20:38:26,553 [2057669]   INFO - er.ForceComMetadataApiDeployer - Deployment status = FAILED 
    2019-02-05 20:38:26,554 [2057670]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest2/debugtest2.js-meta.xml: Cannot find Lightning Component Bundle debugtest2. 
    2019-02-05 20:38:26,555 [2057671]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2/debugtest2.js-meta.xml 
    2019-02-05 20:38:26,573 [2057689]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:38:28,572 [2059688]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    2019-02-05 20:38:28,572 [2059688]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest2/debugtest2.js-meta.xml: Error parsing file: LWC Metadata Xml Parser: Unhandled XML element: StaticResource 
    2019-02-05 20:38:28,572 [2059688]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2/debugtest2.js-meta.xml 
    2019-02-05 20:38:28,572 [2059688]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest2/debugtest2.js: XML parse error: Unhandled XML element: StaticResource 
    2019-02-05 20:38:28,572 [2059688]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2/debugtest2.js 
    2019-02-05 20:38:28,579 [2059695]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:38:30,846 [2061962]   INFO - er.ForceComMetadataApiDeployer - Deployment status = SUCCEEDED_PARTIAL 
    2019-02-05 20:38:30,846 [2061962]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest2/debugtest2.js-meta.xml: Error parsing file: LWC Metadata Xml Parser: Unhandled XML element: StaticResource 
    2019-02-05 20:38:30,846 [2061962]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2/debugtest2.js-meta.xml 
    2019-02-05 20:38:30,847 [2061963]   WARN - er.ForceComMetadataApiDeployer -   Found ERROR for LightningComponentBundle lwc/debugtest2/debugtest2.js: XML parse error: Unhandled XML element: StaticResource 
    2019-02-05 20:38:30,847 [2061963]   INFO - er.ForceComMetadataApiDeployer -   Reporting error for C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2/debugtest2.js 
    2019-02-05 20:38:30,856 [2061972]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    2019-02-05 20:38:30,857 [2061973]   WARN - .IlluminatedCloudExceptionUtil - getInputStream() must not be called against a directory: file://C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2 
    java.io.IOException: getInputStream() must not be called against a directory: file://C:/Users/user/Desktop/Repositories/Spring 19 Pre-release/src/lwc/debugtest2
        at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.getInputStream(VirtualDirectoryImpl.java:676)
        at com.illuminatedcloud.intellij.builder.ForceComBuilderUtil.getFileContentsAsByteArray(ForceComBuilderUtil.java:1066)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.createDeploymentArchive(ForceComMetadataApiDeployer.java:660)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:265)
        at com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer$1.run(ForceComMetadataApiDeployer.java:192)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
        at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
        at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    
  6. Adam Marchbanks

    Sorry Scott, I realise that the error is in the log:

    2019-02-05 20:38:22,209 [2053325]  DEBUG - luminatedCloudFileTemplateUtil - Trying to determine the metadata type for file debugtest2.js in directory debugtest2. 
    2019-02-05 20:38:22,209 [2053325]  DEBUG - luminatedCloudFileTemplateUtil -   The file extension is js. 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil -   The metadata class for that file extension is unknown. 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil -   The JavaScript file extension is . 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil -   Unable to determine the metadata class. Defaulting to StaticResource. 
    2019-02-05 20:38:22,210 [2053326]  DEBUG - luminatedCloudFileTemplateUtil - Setting METADATA_TYPE to StaticResource for file debugtest2.js in directory debugtest2. 
    2019-02-05 20:38:22,536 [2053652]   WARN - ess.util.ProgressIndicatorBase - This progress indicator is indeterminate, this may lead to visual inconsistency. Please call setIndeterminate(false) before you start progress.
    com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer.deployWithMetadataApi(ForceComMetadataApiDeployer.java:234) 
    
  7. Scott Wells repo owner

    Thanks, Adam. Yes, the issue is the "The JavaScript file extension is <blank>." Can you look in Settings/Preferences>Editor>File Types and see what file type has the extension *.js?

  8. Adam Marchbanks

    No problem. The only recognised file type entry I see is "JavaScript (syntax Highlighting Only)" which has the registered pattern "*.js".

  9. Scott Wells repo owner

    I just posted a hotfix build for another issue but included what I hope is a workaround for this issue.. Do you mind updating to 2.0.5.4 to see if that resolves the issue? Either way please provide the same log excerpt so I can see what happened. Thanks!

  10. Adam Marchbanks

    Sorry to say Scott, looks like it fixed it ;)

    <?xml version="1.0" encoding="UTF-8"?>
    <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
        <apiVersion>45.0</apiVersion>
        <description>debugtest</description>
        <isExposed>false</isExposed>
        <masterLabel>debugtest</masterLabel>
    </LightningComponentBundle>
    

    Awesome fix :)

  11. Scott Wells repo owner

    Ah, okay. So maybe this is a Community Edition-only issue where there's not really a formal file type for JavaScript files. The workaround I just created should resolve that issue. I'll also see if I can reproduce the behavior in CE to confirm that suspicion, then I can see if there's a better first-class solution than the workaround I've implemented now.

  12. Scott Wells repo owner

    Hey, I'll take it! And now I think I finally understand why this has been happening, and why it's not happening to everyone. I may have a slightly different implementation of the fix in the next build, but I'll make sure that it continues to work now that it actually it working...

  13. Menachem Mendel Shanowitz

    Hi Scott,

    This is still an issue with version 2.1.1.1.

    When creating a Lightning Web Component: in the js-meta.xml file, the root element is StaticResource, not LightningComponentBundle.

    Thanks.

    P.S. Great job with this plugin, really made my life easier.

  14. Scott Wells repo owner

    Menachem, can you please add the following to Help>Debug Log Settings:

    #com.illuminatedcloud.intellij.filetype.IlluminatedCloudFileTemplateUtil
    

    then reproduce the issue and attach the resulting idea.log file (Help>Show Log in Explorer/Finder/Files)? That will tell me exactly why it's creating that meta.xml file with the wrong metadata type.

  15. Log in to comment