Skip to content

[WIP] support bare-module#862

Draft
maidh91 wants to merge 2 commits intomainfrom
support-bare-module
Draft

[WIP] support bare-module#862
maidh91 wants to merge 2 commits intomainfrom
support-bare-module

Conversation

@maidh91
Copy link
Contributor

@maidh91 maidh91 commented Sep 16, 2025

Depending on

Test
./pear.dev run examples/terminal

Before

Uncaught ModuleError: MODULE_NOT_FOUND: Cannot find module 'prom-client' imported from 'pear://dev/index.js'
    at Module.resolve (file:///Users/MDinh/work/holepunch/pear/node_modules/bare-module/index.js:557:18)
    at require (file:///Users/MDinh/work/holepunch/pear/node_modules/bare-module/index.js:773:27)
    at pear://dev/index.js:2:13
    at Module._evaluate (file:///Users/MDinh/work/holepunch/pear/node_modules/bare-module/index.js:213:7)
    at Module._transform (file:///Users/MDinh/work/holepunch/pear/node_modules/bare-module/index.js:121:12)
    at Module.load (file:///Users/MDinh/work/holepunch/pear/node_modules/bare-module/index.js:485:21)
    at file:///Users/MDinh/work/holepunch/pear/run.js:132:14
    at Timer._run (bare:/bare.js:2555:14)
    at onimmediate (bare:/bare.js:2782:26) {
  code: 'MODULE_NOT_FOUND',
  candidates: []
}
[1]    3258 abort      ./pear.dev run examples/terminal

After

🚀 ~ out: {
  register: Registry {
    _metrics: {},
    _collectors: [],
    _defaultLabels: {},
    _contentType: 'text/plain; version=0.0.4; charset=utf-8'
  },
  Registry: [class Registry],
  contentType: 'text/plain; version=0.0.4; charset=utf-8',
  prometheusContentType: 'text/plain; version=0.0.4; charset=utf-8',
  openMetricsContentType: 'application/openmetrics-text; version=1.0.0; charset=utf-8',
  validateMetricName: [function (anonymous)],
  Counter: [class Counter],
  Gauge: [class Gauge],
  Histogram: [class Histogram],
  Summary: [class Summary],
  Pushgateway: [class Pushgateway],
  linearBuckets: [function (anonymous)],
  exponentialBuckets: [function (anonymous)],
  collectDefaultMetrics: [function collectDefaultMetrics],
  aggregators: {
    sum: [function (anonymous)],
    first: [function (anonymous)],
    omit: [function omit],
    average: [function (anonymous)],
    min: [function (anonymous)],
    max: [function (anonymous)]
  },
  AggregatorRegistry: [class AggregatorRegistry]
}

@maidh91 maidh91 marked this pull request as draft September 16, 2025 14:39
@maidh91 maidh91 changed the title support bare-module [WIP] support bare-module Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant