Closed albertlaiuste closed 9 months ago
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.
What version of pkg are you using?
5.8.1
What version of Node.js are you using?
16.18.1
What operating system are you using?
Debian 12
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node16-linux-x64
Describe the Bug
I encountered an issue with
express-openapi
when using it in conjunction with thepkg
, like:pkg . --no-bytecode --public-packages "*" --public
. The issue arises whenexpress-openapi
tries to dynamically import modules using import with thefile://
protocol in a bundled environment, like:const imported = await import(`file://${fsRoutesItem.path}`)
. It seems that the library is attempting to load modules from the local filesystem rather than from within the bundled package.I understand that this may be a known issue, but I'm sharing it here in case anyone else encounters a similar problem with the library. I also want to provide a temporary solution that worked for me.
Solution: I was able to resolve this issue by manually patching the
await import
line in mypackage.json
configuration, like so:Expected Behavior
In a bundled environment, express-openapi should correctly load modules from within the bundled package, rather than attempting to load them from the local filesystem.
To Reproduce