Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstallError: ember-resources -- installing the packaged failed #591

Open
NullVoxPopuli opened this issue Dec 3, 2021 · 13 comments
Open
Assignees

Comments

@NullVoxPopuli
Copy link

NullVoxPopuli commented Dec 3, 2021

ember-resources

error: https://bundlephobia.com/package/ember-resources
github: (builds with rollup): https://github.com/NullVoxPopuli/ember-resources/tree/main/ember-resources
but on npm, it's pre-built as a single file

Entire (stringified) error that I see in my browser console

Object { error: {…} }
​
error: Object { code: "InstallError", message: "Installing the packaged failed.", details: {} }
​​
code: "InstallError"
​​
details: Object {  }
​​​
<prototype>: Object { … }
​​
message: "Installing the packaged failed."
​​
<prototype>: Object { … }
​
<prototype>: Object { … }
react_devtools_backend.js:2540:25
    overrideMethod react_devtools_backend.js:2540
    r ResultPage.js:106
    (Async: promise callback)
    r ResultPage.js:79
    r ResultPage.js:179
    React 3
    unstable_runWithPriority scheduler.production.min.js:18
    React 4
    unstable_runWithPriority scheduler.production.min.js:18
    React 6
    ye index.tsx:520
    ye index.tsx:789
    e index.tsx:425
    l runtime.js:63
    _invoke runtime.js:293
    P runtime.js:118
    Babel 4
    NextJS 2
    e index.tsx:411
    l runtime.js:63
    _invoke runtime.js:293
    P runtime.js:118
    Babel 8
    ie NextJS
    BMP1 next.js:5
    Webpack 4

@NullVoxPopuli
Copy link
Author

@NullVoxPopuli
Copy link
Author

@NullVoxPopuli
Copy link
Author

Does bundle phobia have assumptions around how these libraries should be built?

They're already built. What's in dist/ is all there is. No need to worry about dependencies or anything, because the consuming application handles that.

@n10l
Copy link

n10l commented Dec 26, 2021

@NullVoxPopuli I faced same issue and run bundlephobia locally, seems like a timeout issue. Feel free to use my PR #596 if it helps. Any feedback welcome.

@n10l
Copy link

n10l commented Dec 26, 2021

@NullVoxPopuli I tried your package in local bundlephobia and it seems to have real build issue not the timeout one as mine.

image

@NullVoxPopuli
Copy link
Author

NullVoxPopuli commented Dec 26, 2021

Thanks for taking a look!
What is it building with?
I use rollup, and it builds just fine.
Is it also trying to parse / load the module? I target fairly modern browsers, so i wonder if whatever is throwing that error just doesn't support all stage 3/4 proposals that are currently available in chrome/firefox?

Based on the picture, it's struggling with ??, perhaps?

@n10l
Copy link

n10l commented Dec 26, 2021

You may look into this stackoverflow post https://stackoverflow.com/questions/63423384/you-may-need-an-additional-loader-to-handle-the-result-of-these-loaders
Could be problem that you might be emitting ES2020 to dist/ folder. Just a hint, you may need to debug deeper into this, or wait for @pastelsky to confirm this.

I recently written some boilerplates based on rollup, where this is not the issue, in case if it helps.
https://github.com/hackingbay/react-package-boilerplate - ReactJS
https://github.com/hackingbay/js-package-minimal-boilerplate - PlainJS

Typescript versions I am bringing soon.

@NullVoxPopuli
Copy link
Author

NullVoxPopuli commented Dec 26, 2021

you might be emitting ES2020 to dist/ folder

Why is that a problem tho? Like, i won't emit less modern code. -- browsers support the syntax I'm using.

Is there a way to tell the bundlephobia loader what targets to use?

boilerplates based on rollup, where this is not the issue, in case if it helps.

Thanks for these - my compilation is fine though in real world uses / production apps.

@NullVoxPopuli
Copy link
Author

Is the solution to make bundlephobia's analysis target evergreen browsers?

@NullVoxPopuli
Copy link
Author

is it sufficient to have bundlephobia to just measure the file sizes in dist?

@pastelsky
Copy link
Owner

@NullVoxPopuli no, there's no standard indicating that built files must be in a dist folder — and hence packages usually have different dist paths. Also, a majority of libraries do not bundle files in dist — they just run it through babel. Which is the reason bundlephobia was created — and we continue to aim to be library agnostic.

You must indicate an entry point into your application (via a main package.json entry) in this case, otherwise consumes would not be able to use your library without diving inside `dist, which is an antipattren.

@NullVoxPopuli
Copy link
Author

NullVoxPopuli commented Jul 21, 2022

My package.json declares 'exports' as main is insufficient (and also allows files to be 'wherever'). Will bundle phobia support 'exports'?

@KaelWD
Copy link

KaelWD commented Aug 14, 2022

#379

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

No branches or pull requests

4 participants