bundlejs icon indicating copy to clipboard operation
bundlejs copied to clipboard

Do not know how to load path: http-url:https://unpkg.com/@opentelemetry/[email protected]/src/platform/browser/index.ts

Open artalar opened this issue 5 months ago • 2 comments

The default example of https://www.npmjs.com/package/@opentelemetry/sdk-trace-web is not bundling :(

import {
  ConsoleSpanExporter,
  SimpleSpanProcessor,
  WebTracerProvider,
} from '@opentelemetry/sdk-trace-web';
import { DocumentLoad } from '@opentelemetry/plugin-document-load';
import { ZoneContextManager } from '@opentelemetry/context-zone';
import { registerInstrumentations } from '@opentelemetry/instrumentation';

const provider = new WebTracerProvider({
  spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())]
});

provider.register({
  // Changing default contextManager to use ZoneContextManager - supports asynchronous operations - optional
  contextManager: new ZoneContextManager(),
});

// Registering instrumentations / plugins
registerInstrumentations({
  instrumentations: [
    new DocumentLoad(),
  ],
});

artalar avatar Jun 03 '25 07:06 artalar

I won't have time for a short bit but I will try getting to it when I get a chance,

but I've basically identified the problem, the issue basically has to do with the interpretation of the browser field from the package.json

https://app.unpkg.com/@opentelemetry/[email protected]/files/package.json Image

instead of using the build path it's using the src path which just doesn't exist,

Image

okikio avatar Jun 04 '25 06:06 okikio

it looks like the opentelemetry package has this in a bunch of the sub-packages,

to solve this might require bundlejs to prioritize main over the browser field, which might make bundles less browser friendly,

Image

so you basically might no longer be able to copy a bundle and start using it in Codepen or something like that, which in my mind is kind of a loss of functionality,

I might have to think about the best solution to this problem

okikio avatar Jun 04 '25 06:06 okikio

Similar issue with overlayscrollbars

import { 
  OverlayScrollbars, 
  ScrollbarsHidingPlugin, 
  SizeObserverPlugin, 
  ClickScrollPlugin 
} from 'overlayscrollbars';

console.log(OverlayScrollbars, ScrollbarsHidingPlugin, SizeObserverPlugin, ClickScrollPlugin);

Error:

✘ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/overlayscrollbars.mjs

/input.ts:7:7:

      7 │ } from 'overlayscrollbars';
        ╵        ~~~~~~~~~~~~~~~~~~~

Repro bundlejs.com

Akiyamka avatar Jun 17 '25 11:06 Akiyamka

Similar issues with Vuetify:

✘ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/lib/composables/hotkey/hotkey-parsing.js
✘ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/lib/composables/locale.js
✘ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/lib/util/box.js
✘ [ERROR] Do not know how to load path: http-url:https://unpkg.com/[email protected]/lib/util/getScrollParent.js

https://bundlejs.com/?q=vuetify%403.9.5&treeshake=%5B*%5D

rijenkii avatar Aug 15 '25 09:08 rijenkii