bundlejs
bundlejs copied to clipboard
Do not know how to load path: http-url:https://unpkg.com/@opentelemetry/[email protected]/src/platform/browser/index.ts
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(),
],
});
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
instead of using the build path it's using the src path which just doesn't exist,
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,
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
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
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