Sandpack/nodebox-runtime

Process exits when --conditions option is used

Opened this issue · 1 comments

When I try to pass the arguments -C foo (or equivalently--conditions=foo) to the node process, it exits with status code 1. Are conditional export resolution conditions supported by Nodebox? If not, what would be required to add support?

This is pursuant to getting React Server Components demos going in the React documentation. The Webpack plugin that processes Server Components has to be imported with the react-server condition set in order to work.

As an aside, I'm accessing Nodebox via Sandpack and when the process exits, I haven't been able to find how to get a stacktrace for the call to process.exit() or any other helpful information. Any tips here would be appreciated.

I'd like to post a succinct repro using nodebox-runtime directly, but am unable to run any of the scripts for this package. I get errors like this:

$ pnpm build               

> nodebox@0.0.0 build /Users/davemccabe/src/nodebox-runtime
> turbo run build --no-cache && pnpm build:consumer

 ERROR  run failed: could not unmarshal lockfile: : yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `6.0` into float32
  line 12: cannot unmarshal !!map into string
  line 15: cannot unmarshal !!map into string
  line 18: cannot unmarshal !!map into string
  line 21: cannot unmarshal !!map into string
  line 24: cannot unmarshal !!map into string
  line 27: cannot unmarshal !!map into string
  line 30: cannot unmarshal !!map into string
  line 33: cannot unmarshal !!map into string
  line 36: cannot unmarshal !!map into string
  line 39: cannot unmarshal !!map into string
  line 42: cannot unmarshal !!map into string
  line 45: cannot unmarshal !!map into string
  line 48: cannot unmarshal !!map into string
  line 52: cannot unmarshal !!map into string
  line 55: cannot unmarshal !!map into string
  line 58: cannot unmarshal !!map into string
  line 61: cannot unmarshal !!map into string
  line 64: cannot unmarshal !!map into string
  line 67: cannot unmarshal !!map into string
  line 70: cannot unmarshal !!map into string
  line 73: cannot unmarshal !!map into string
  line 76: cannot unmarshal !!map into string
  line 79: cannot unmarshal !!map into string
  line 82: cannot unmarshal !!map into string
  line 85: cannot unmarshal !!map into string
  line 88: cannot unmarshal !!map into string
  line 91: cannot unmarshal !!map into string
  line 94: cannot unmarshal !!map into string
  line 97: cannot unmarshal !!map into string
  line 100: cannot unmarshal !!map into string
  line 103: cannot unmarshal !!map into string
  line 106: cannot unmarshal !!map into string
  line 109: cannot unmarshal !!map into string
  line 112: cannot unmarshal !!map into string
  line 115: cannot unmarshal !!map into string
  line 118: cannot unmarshal !!map into string
  line 121: cannot unmarshal !!map into string
  line 124: cannot unmarshal !!map into string
  line 127: cannot unmarshal !!map into string
  line 133: cannot unmarshal !!map into string
  line 136: cannot unmarshal !!map into string
 ELIFECYCLE  Command failed with exit code 1.

I am using pnpm version 8.10.2. If you could direct me to how to run the tests or something for nodebox-runtime then I will post a repro.

Currently we don't support this cli flag, I think this would be fairly simple to implement, but not sure when we would have time to look into this