What Node versions, OSs and CPU architectures are you building for?
node20-linux-x64, node20-windows-x64
Describe the Bug
Calling playwright through the binary (node_modules/.bin), the same way as it used to work with the original vercel/pkg, it throws the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/snapshot/autotest/node_modules/playwright/lib/transform/esmLoader.js' imported from /snapshot/autotest/node_modules/playwright/lib/common/esmLoaderHost.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1169:11)
at nextResolve (node:internal/modules/esm/hooks:868:28)
at Hooks.resolve (node:internal/modules/esm/hooks:306:30)
at ModuleLoader.resolve (node:internal/modules/esm/loader:503:35)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
at ModuleLoader.import (node:internal/modules/esm/loader:472:34)
at Hooks.register (node:internal/modules/esm/hooks:167:34)
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///snapshot/autotest/node_modules/playwright/lib/transform/esmLoader.js'
}
While the following code (from within the compiled program):
console.log(fs.readdirSync("/snapshot/autotest/node_modules/playwright/lib/transform"));
Try to check https://github.com/yao-pkg/pkg#troubleshooting and then if nothing works go to last advanced section to create a debug binary and lunch it to see if you can gain some more informations
What version of pkg are you using?
6.1.0
What version of Node.js are you using?
20
What operating system are you using?
Fedora 41
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node20-linux-x64, node20-windows-x64
Describe the Bug
Calling playwright through the binary (node_modules/.bin), the same way as it used to work with the original vercel/pkg, it throws the following error:
While the following code (from within the compiled program):
console.log(fs.readdirSync("/snapshot/autotest/node_modules/playwright/lib/transform"));
Gives the following result:
Indicating that the required file is clearly present in the snapshot.
Expected Behavior
The module import should be successful.
To Reproduce
Have the following config for pkg in your package.json:
Try to call playwright test from within the compiled code, according to this: