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´m trying to run Lighthouse programmatically in a custom TypeScript GitHub Action. Unfortunately I cannot get it running after bundling with ncc.
After bundling via npx ncc build src/index.ts -o dist --source-map I run into an issue when running the index.js.
Also I see issues when running the jest tests
SyntaxError: Cannot use import statement outside a module
> 1 | import lighthouse from 'lighthouse'
| ^
2 | import { launch } from 'puppeteer'
3 |
4 | export async function runLighthouse(): Promise<void> {
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
at Object.require (src/lighthouse.ts:1:1)
at Object.require (src/main.ts:2:1)
at Object.<anonymous> (__tests__/index.test.ts:5:1)
Error: ENOENT: no such file or directory, open '/home/runner/work/lighthouse-demo-action/lighthouse-demo-action/dist/locales/ar.json'
at Object.readFileSync (node:fs:448:20)
at Object.41812 (file:///home/runner/work/lighthouse-demo-action/lighthouse-demo-action/node_modules/lighthouse/shared/localization/locales.js:[3](https://github.com/pascalknupper/lighthouse-demo-action/actions/runs/10089178347/job/27896189514#step:3:4)5:1)
at __nccwpck_require__ (file:///home/runner/work/lighthouse-demo-action/lighthouse-demo-action/webpack/bootstrap:21:1)
at file:///home/runner/work/lighthouse-demo-action/lighthouse-demo-action/webpack/startup:[4](https://github.com/pascalknupper/lighthouse-demo-action/actions/runs/10089178347/job/27896189514#step:3:5):1
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:[5](https://github.com/pascalknupper/lighthouse-demo-action/actions/runs/10089178347/job/27896189514#step:3:6))
How do I use the lighthouse npm package correctly in a TypeScript GitHub Action?
I´m trying to run Lighthouse programmatically in a custom TypeScript GitHub Action. Unfortunately I cannot get it running after bundling with ncc.
After bundling via
npx ncc build src/index.ts -o dist --source-map
I run into an issue when running the index.js.Also I see issues when running the jest tests
How do I use the lighthouse npm package correctly in a TypeScript GitHub Action?
This is my demo GitHub Action https://github.com/pascalknupper/lighthouse-demo-action
The text was updated successfully, but these errors were encountered: