Shopware 6.7 Build JS Not Working on Mac: How to Fix basePaths[@]: unbound variable Error
If you are a Shopware developer working on a Mac, you might encounter an issue while building your storefront or administration with Shopware 6.7. Running the standard build commands sometimes results in an error like:
bin/build-storefront.sh: line 53: basePaths[@]: unbound variable
This can be frustrating, especially if you are trying to run bin/build-storefront.sh or bin/build-administration.sh as part of your development workflow. In this article, we explain why this happens and provide a quick fix so you can continue building your Shopware store without issues.
Why This Error Happens
The error occurs due to differences in bash array handling on macOS. Unlike Linux, macOS ships with an older version of bash that treats uninitialized arrays differently.
In the build scripts, the array basePaths is accessed even when it is not yet initialized. This leads to the “unbound variable” error, preventing the build from completing successfully.
How to Fix the Issue
Follow these steps to resolve the basePaths[@]: unbound variable error on Mac:
1. Open the Build Scripts
Locate and open the following files in your Shopware 6.7 folder structure:
- bin > build-storefront.sh
- bin > build-administration.sh
2. Update the Array Check
In both files, find the line (around line 53):
if [[ -n $srcPath && ! ” ${basePaths[@]} ” =~ ” ${basePath} ” ]]; then
Replace it with:
if [[ -n $srcPath && ! ” ${basePaths[*]:-} ” =~ ” ${basePath} ” ]]; then
Explanation:
- ${basePaths[*]:-} ensures that the script does not fail even if basePaths is uninitialized.
- This change makes the script compatible with macOS’s default shell environment.
3. Save and Rerun
After updating the files, save them and rerun the build commands:
bin/build-storefront.sh
bin/build-administration.sh
The scripts should now run without errors, allowing your JavaScript build to complete successfully.
Conclusion
If your Shopware 6.7 build JS is not working on Mac and shows the basePaths[@]: unbound variable error, it’s usually due to uninitialized arrays in the build scripts. Updating the array syntax as described above resolves the issue and ensures smooth storefront and administration builds on macOS.
By following this fix, Mac users can continue developing and customizing Shopware stores without interruptions.
Recent help desk articles

Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
