AssetMapperTypeScriptBundle icon indicating copy to clipboard operation
AssetMapperTypeScriptBundle copied to clipboard

SWC cannot build "chart.js"

Open pan93412 opened this issue 1 year ago • 1 comments

The upstream bug is: https://github.com/swc-project/swc/issues/9559

$ '/Volumes/Dev/ResearchProject/lets-php/app-sf/var/swc-darwin-arm64' 'compile' 'assets' '--out-dir' '/Volumes/Dev/ResearchProject/lets-php/app-sf/var/typescript' '--config-file' '.swcrc'
Error: Failed to open file assets/vendor/chart.js

Caused by:
    Is a directory (os error 21)
  • [x] Wait for SWC fixes this issue (https://github.com/swc-project/swc/commit/85cc2bd79c3193cb0a8b54e4fce0efc1aa15b271)
  • [ ] Upgrade SWC to the fixed version (https://github.com/sensiolabs/AssetMapperTypeScriptBundle/blob/main/src/Tools/TypeScriptBinaryFactory.php)

pan93412 avatar Sep 17 '24 03:09 pan93412

Found a simple workaround – just move the files to build to a separate folder:

CleanShot 2024-09-17 at 22 52 37@2x

sensiolabs_typescript:
  source_dir:
    - "%kernel.project_dir%/assets/app"
    - "%kernel.project_dir%/assets/controllers"
  swc_version: v1.7.26

pan93412 avatar Sep 17 '24 14:09 pan93412

Hi are there any news to this ticket? It looks like SWC already solved this bug and approved your commit.

EvilKarter avatar Nov 18 '24 15:11 EvilKarter

Hi are there any news to this ticket? It looks like SWC already solved this bug and approved your commit.

You can manually upgrade to SWC v1.9. To ensure backward compatibility, we prefer not to update the built-in version in TypeScriptBundle. Sorry!

pan93412 avatar Nov 18 '24 15:11 pan93412