Hello,
I've encountered an issue with the @kindspells/astro-shield
integration where it generates incorrect paths for hoisted scripts during the build process. Specifically, the integration adds a .
prefix to the _astro
directory, resulting in paths like ./._astro/hoisted.*.js
, causing the following errors during build:
assets
directory defined in astro.config.mjs
:
build: {
assets: 'nameOfFolder',
},
ENOENT: no such file or directory, open 'C:\path\to\project\dist\.nameOfFolder\hoisted.[hash].js'
ENOENT: no such file or directory, open 'C:\path\to\project\dist\._astro\hoisted.[hash].js'
The issue persists even with the default settings. I tested it on a static Astro project, and the same error occurred. It seems like the integration mishandles asset paths when creating integrity hashes for hoisted scripts.
@kindspells/astro-shield
integration.astro build
.Hoisted scripts should be placed in the correct _astro
directory without the extra .
prefix.
The build fails due to incorrect paths like ._astro
being used.
The issue seems to be caused by an unnecessary .
prefix being added when generating paths for hoisted assets. Upon testing, removing this prefix resolves the issue in my project setup. I recommend reviewing the logic responsible for path handling and conditionally applying the .
prefix only when necessary, as it may not be universally required for all builds.
This should help maintain compatibility across different configurations.
Thank you for your assistance!
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too