I created a CSS-only LWC to share CSS among multiple LWCs. As soon as other LWCs include the code to import the shared CSS, they can no longer be deployed to or retrieved from the org using the CLI (I've used Workbench as a workaround). The message received reads:
ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined
Repository to reproduce: dreamhouse-lwc
Files created in repository sharedCssBug
To reproduce, follow steps in release notes exactly.
One should successfully be able to retrieve and deploy myComponent using force:source:deploy and force:source:retrieve.
When running force:source:retrieve, the following error message is received:
ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined
Results from --loglevel trace: retrieveTrace.txt
Results from --dev-debug: retrieveDebug.txt
When running force:source:deploy, the following error message is received:
No MODULE named markup://c:cssLibrary found : [markup://c:myComponent]
Results from --loglevel trace: deployTrace.txt
Results from --dev-debug: deployDebug.txt
NOTE: the attached text documents with debug/trace results are from my org where I initially experienced the problem, so the names of components don't match up to the samples. All the trace/debug docs can also be found in the linked repository above.
SFDX CLI Version: sfdx-cli/7.65.6-23e8b7f47e win32-x64 node-v12.13.0
SFDX plugin Version: salesforcedx 48.22.11 (core)
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.4.0
鈹溾攢 @oclif/plugin-help 2.2.3
鈹斺攢 @oclif/plugin-update 1.3.9
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 48.22.11 (core)
鈹溾攢 salesforce-alm 48.24.3 (core)
鈹溾攢 salesforcedx-templates 48.18.0 (core)
鈹溾攢 custom-metadata 1.0.4 (core)
鈹斺攢 @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
sfdx-cli 7.65.6 (core)
OS and version: Windows 10 Business
Let us know if you need another example. We are seeing the same behavior on force:source:deploy.
Update:
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 49.2.3 (core)
鈹溾攢 salesforce-alm 49.3.0 (core)
鈹溾攢 salesforcedx-templates 48.32.0 (core)
鈹溾攢 custom-metadata 1.0.7 (core)
鈹斺攢 @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
sfdx-cli 7.66.2 (core)
ERROR running force:source:retrieve: Cannot read property 'fileName' of undefined is definitely a theme with lots of recent issues so we'll get it fixed asap. Thank you!
Is there any ETA on this fix?
Also looking for an ETA on this issue... The only workaround is to deploy the shared CSS component every time you deploy any component that imports it, but you must use the CLI and not the VSCode extensions. It's very frustrating.
+1 on this. A fix will be much appreciated!
This looks the same as #496 and #400. The fix will be in the next patch release.
Most helpful comment
Also looking for an ETA on this issue... The only workaround is to deploy the shared CSS component every time you deploy any component that imports it, but you must use the CLI and not the VSCode extensions. It's very frustrating.