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
I was trying to write my own WriteToStorage plugin, but it was never called.
Investigating the issue I have found out the reason for it:
in /src/lib/utils/handlers/renderParallel.ts the plugin is fetched while executing the following static code:
const writeToFs = findPlugin(WriteToStorage);
That's done before the configuration is compiled and executed, as a result any attempt to replace the plugin won't have any effect.
A simple fix for this would be to fetch the plugin only when needed it:
let writeToFs;
const reThrow = (e) => {
throw new Error(e);
};
let executePluginsForRoute;
export async function renderParallel(dataRoutes: any[]): Promise {
writeToFs = writeToFs || findPlugin(WriteToStorage); // defer init of writeToFs till it's needed and avoid calling findPlugin() all the time
executePluginsForRoute = executePluginsForRoute || findPlugin(renderRoute);
...
🐞 Bug report
Description
I was trying to write my own WriteToStorage plugin, but it was never called.
Investigating the issue I have found out the reason for it:
in /src/lib/utils/handlers/renderParallel.ts the plugin is fetched while executing the following static code:
const writeToFs = findPlugin(WriteToStorage);
That's done before the configuration is compiled and executed, as a result any attempt to replace the plugin won't have any effect.
A simple fix for this would be to fetch the plugin only when needed it:
NOTE:
🔬 Minimal Reproduction
add a
💻Your Environment
Angular Version:
Scully Version:
🔥 Exception or Error
The text was updated successfully, but these errors were encountered: