-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Erroneous builds, parcelRequire, and manifestations of a bundling problem #859
Comments
same error |
It is living error. Is there anyone can find a solution that? |
@StoneCypher Thank you for the detailed issue. In the next version we'll include esm/cjs files, so it'll suite for all cases. NodeJS support already exists in beta. You can try it via npm i peerjs@beta |
I'm not interested in node. I just want this to work in a regular build. Does the cjs build still have access to browser primitives? How far out is 2? Are you aware of anyone having this working in a regular build? This blocked me for a nine months. I went to a competitor |
# [1.4.0](v1.3.2...v1.4.0) (2022-05-10) ### Bug Fixes * add changelog and npm version to the repo ([d5bd955](d5bd955)) * add token to PeerJSOption type definition ([e7675e1](e7675e1)) * websocket connection string ([82b8c71](82b8c71)) ### Features * upgrade to Parcel@2 ([aae9d1f](aae9d1f)), closes [#845](#845) [#859](#859) [#552](#552) [#585](#585) ### Performance Improvements * **turn:** lower TURN-latency due to more local servers ([a412ea4](a412ea4))
Thank you for your detailed report, @StoneCypher. Parcel@1 had some long-standing bugs that weren’t fixed because the engineering capacity was bound for version 2. It was the same for PeerJS: Creating a possible version 2 delayed fixes for version 1. Also our two main maintainers hadn’t had much time for personal reasons. That changed; we now got two maintainers working on PeerJS and are prioritizing version 1. We are back on track. All bundling issues should be fixed from version Node support is coming but is not high on the priority list. Node does not support WebRTC natively, and its polyfill |
Hiya.
Something's weirdly wrong with your build. I don't use
parcel
, so I don't know exactly what, but.It appears that Parcel has an internal implementation of
require
calledparcelRequire
which isn't being put into your build, or is being put into your build in a way that isn't visible in all places, or perhaps is expected to be provided downstream.You see a variety of strange manifestations of this when your users are using other bundlers:
I hit this myself. Here is a near-minimal build using
rollup
. Unfortuantely, you're looking through minified code. To find the correct location (line 21 column 890,) either copy pasta into a code editor, or search forparcelRequire=f,i)throw i;return f}({"EgBh")
. The revealed selection starts (ie,parcelRequire=
) at the throw.I believe that this is either a timing or a scope visibility bug, on grounds that several people believe they are solving it by making a global with the correct name, at which point the throw goes away (ostensibly because it's now pointing at some irrelevant variable,) only to be replaced by a complaint that the needed constructor or some needed method doesn't exist on said throwaway.
jmonster suggests that the issue is merely the missing declaration of the outer scoped variable, and jlalmes provides a shim on the window object by matching name, which falls into scope through globality rules, but which would break on
node
.It seems that this is expositional - in #761 the user is able to self-service by dealing with the scoped instance on the
window
global. Whatever the problem is is resolved by the time that member is bound.Either way,
parcel
shouldn't be building. If it's a missing outer scope variable it should reject, and if it's being pushed before it's ready it should be being deferred.∴ I believe your
parcel
configuration to be damaged.It's worth noting that there's a possibly-related issue:
Strictly speaking this isn't related. However I would have expected a library like
peerjs
to be available tonode
, and right now it's requiring thewindow
global, which isnode
-antithetical. If you expectparcel
to be testing for that, or packing in a shim or a sham, it's not currently doing so.The text was updated successfully, but these errors were encountered: