Closed lirc571 closed 2 months ago
Thanks for the issue. Usually, looking at the minimal repro is the fastest way for me to understand what the problem is, validate it, and debug it. LMK when you have that ready and we can re-open this.
If you need help, you can sponsor me and join my private org and I can also help you out there.
@privatenumber I have created a repo at https://github.com/lirc571/pkgroll-65. Bundled output at /dist
included.
Switched to tsup which works out of the box and is actively maintained.
pkgroll is a wrapper around Rollup so any bundling issue should be filed there. The reason it works in tsup is because of esbuild, not tsup.
Switched to tsup which works out of the box and is actively maintained.
pkgroll is actively maintained. You're just not entitled to free support.
Thank you! That's perfectly understandable!
I just wanted to provide my solution here to wrap up this issue so someone experiencing similar issues would know what to do.
Problem
I have a TypeScript project with the following dependency graph (
server.ts
dynamically importssubprocess.ts
):It is bundled into the following by
pkgroll
:Somehow
index.ts
andlog.ts
are bundled intoindex-Cbj.mjs
, which creates a cyclic dependency.index.mjs
contains only a list of top-level imports.When I run it with Node.js, it exits with code 13 (Unsettled Top-Level Await).
The same code runs successfully with
tsx
.I am not sure what the root cause is, but it is very strange to bundle the entry file
index.ts
with some other exports because that will certainly cause cyclic dependency, similar to https://github.com/nodejs/node/issues/44601#issue-1368994246.Expected behavior
Bundling should not create cyclic dependencies.
The entrypoint should not be merged with exports.
Minimal reproduction URL
https://github.com/lirc571/pkgroll-65
Version
v2.0.2
Node.js version
v20.12.2
Package manager
pnpm
Operating system
Linux
Contributions