okikio / bundlejs

An online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.
https://bundlejs.com
MIT License
751 stars 13 forks source link

✘ [ERROR] Do not know how to load path: http-url:{JS_FILE_PATH} #67

Closed samijaber closed 8 months ago

samijaber commented 8 months ago

I get this error:

✘ [ERROR] Do not know how to load path: http-url:https://unpkg.com/@builder.io/sdk-react-native@0.8.0/lib/browser/module/index-helpers/blocks-exports.js

http-url:https://unpkg.com/@builder.io/sdk-react-native@0.8.0/lib/browser/module/index.js:2:14:

      2 │ export * from "./index-helpers/blocks-exports.js";
        ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When trying to bundle @builder.io/sdk-react-native: https://bundlejs.com/?q=%40builder.io%2Fsdk-react-native%400.8.0

I'm not sure what the issue us, the file loads just fine and obviously exists: https://unpkg.com/@builder.io/sdk-react-native@0.8.0/lib/browser/module/index-helpers/blocks-exports.js

Let me know if you need any more details!

okikio commented 8 months ago

Thanks for taking the time, after some thorough review I've confirmed the issue

^ For the version of the hermes-profile-transformer@0.0.6 being used, the /dist/hermes-tracing-profile-transformer.esm.js which is the official esm module listed by the package.json, but unfortunately it doesn't exists in version hermes-profile-transformer@0.0.6.

okikio commented 8 months ago

A possible solution is

{
  // ...,
  "alias": {
    "hermes-profile-transformer": "hermes-profile-transformer@0.0.6/dist/index.js"
  }
}

But all in all bundlejs doesn't have great support for react-native yet, but this is a workflow I plan to handle fairly soon.

Also, react-native uses a bunch of flow syntax which just drives esbuild crazy, so that's something I need to handle as well

samijaber commented 8 months ago

Thanks for investigating!

I tried your suggestion, and externalized react-native: https://bundlejs.com/?q=%40builder.io%2Fsdk-react-native%400.8.0&config=%7B%22esbuild%22%3A%7B%22alias%22%3A%7B%22hermes-profile-transformer%22%3A%22hermes-profile-transformer%400.0.6%2Fdist%2Findex.js%22%7D%2C%22external%22%3A%5B%22react-native%22%5D%7D%7D

It still ends up erroring, but in a different place:

Error: [getRequest] Failed at request (https://unpkg.com/@builder.io/sdk-react-native@0.8.0/lib/browser/module/functions/set.js)

TypeError: Failed to fetch

file exists: https://unpkg.com/@builder.io/sdk-react-native@0.8.0/lib/browser/module/functions/set.js

okikio commented 8 months ago

That might've been a one off cause it works for me SmartSelect_20240108-123548_Kiwi Browser.jpg

deno.bundlejs.com/badge?q=@builder.io/sdk-react-native@0.8.0&config={"esbuild":{"alias":{"hermes-profile-transformer":"hermes-profile-transformer@0.0.6/dist/index.js"},"external":["react-native"]}}

badge

samijaber commented 8 months ago

Ah, thanks! From my experience, unpkg can be slow for the first request to a file...I imagine bundlejs times out, but then after I clicked on all of them, that caused the unpkg cache to populate so it worked for you.

I'm going to close this issue. Thank you for your help!