You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The createStorage method called in the Nitro build process hardcodes the current build directory path into the build artifacts. This behavior causes issues when the compiled project is moved to a different environment (e.g., when deployed in a container).
This code block is produced in rollup/plugins/storage.ts and calls the createStorage method defined in core/utils/storage.ts.
Here it will call the unstorage defineDriver for the appropriate driver and set the returned value as first parameter for the mount method.
I think that the createStorage utility from nitro should be called at runtime, and not at build time. In this way the build path will not be set as a prefix for the driver path, instead it will use the current working directory of the project.
Environment
Latest nitro version, the issue is not related to the environment.
Reproduction
To reproduce this issue you need to have storage configured with an fs or fslite driver, like in the following nitro configuration:
Describe the bug
The createStorage method called in the Nitro build process hardcodes the current build directory path into the build artifacts. This behavior causes issues when the compiled project is moved to a different environment (e.g., when deployed in a container).
This code block is produced in
rollup/plugins/storage.ts
and calls the createStorage method defined incore/utils/storage.ts
.Here it will call the unstorage defineDriver for the appropriate driver and set the returned value as first parameter for the mount method.
I think that the createStorage utility from nitro should be called at runtime, and not at build time. In this way the build path will not be set as a prefix for the driver path, instead it will use the current working directory of the project.
This is related to this issue unjs/unstorage#566
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: