Injecting local script tag onto page
But when i try to run this on the apify platform, I get "No Such File Or Directory" errors. How can i reference files from my package on the apify platform so I can inject them into a page?
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const SINGLE_FILES = [
'single-file-bootstrap.js',
'single-file-frames.js',
'single-file-hooks-frames.js',
'single-file.js'
];
export const SINGLE_FILE_PATHS = SINGLE_FILES.map(file => path.join(__dirname, 'single-file', file));
export async function addScriptsToPage(page: Page) {
try {
for (const scriptPath of SINGLE_FILE_PATHS) {
await page.addScriptTag({ path: scriptPath });
}
} catch(e) {
console.error('Error adding scripts to page', e);
return { success: false, error: e };
}
return { success: true };
}**Platform gracefully auto-aborts PPE runs over $$$ limit** Due to developer feedback about issues implementing the Actor max charge limit set on every run, we have implemented a backstop. From today’s release, when the platform discovers that the run has hit the Actor max charge limit, the run will be automatically aborted, with 30 seconds graceful period. <@&999256322673496174> <@&1092713625141137429> You should use`Actor.on('aborting', () => {…cleanup and terminate as soon as possible…})`. If you're not already handling this `aborting` event anyway, please start to. Docs are incoming and I'll update this announcement with the link when it's ready.
ellativity · 11h ago
**Dynamic Actor memory is here** For those who missed Creator Cantina yesterday, I announced in the call that you can now set your Actors up to use dynamic memory based on input size and run options (e.g. if more URLs are input or more detail is requested). Check out more info in the docs here: https://docs.apify.com/platform/actors/development/actor-definition/dynamic-actor-memory
ellativity · 13h ago
Hey @everyone, I'm in https://discord.com/channels/801163717915574323/1430491198145167371 if you want to hop in to discuss the ID verification or anything else, such as the $1M Challenge
ellativity · 2d ago