-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
[rstream] error when using skypack build #462
Comments
Hi @snosenzo - thank you for reporting this! It indeed seems to be a transpilation issue with skypack. The JS emitted by TypeScript (and the code distributed in the package) currently should look like this: class Stream extends Subscription {
src;
_cancel;
_inited;
constructor(src, opts) {
const [_src, _opts] = isFunction(src) ? [src, opts || {}] : [void 0, src || {}];
super(
_opts.error ? { error: _opts.error } : void 0,
__optsWithID("stream", _opts)
);
this.src = _src;
this._inited = false;
} Will have to look into this, since this likely will impact alot of other packages... Do you know if that's only a recent issue or is it your first time trying out the skypack version? |
Yeah, looking at https://cdn.skypack.dev/@thi.ng/rstream/stream, it seems skypack defaults to ES2019 syntax and hence will transpile & inject the class field initializers: /*
* Skypack CDN - @thi.ng/[email protected]
*
* Learn more:
* 📙 Package Documentation: https://www.skypack.dev/view/@thi.ng/rstream
* 📘 Skypack Documentation: https://www.skypack.dev/docs
*
* Pinned URL: (Optimized for Production)
* ▶️ Normal: https://cdn.skypack.dev/pin/@thi.ng/[email protected]/mode=imports/optimized/@thi.ng/rstream/stream.js
* ⏩ Minified: https://cdn.skypack.dev/pin/@thi.ng/[email protected]/mode=imports,min/optimized/@thi.ng/rstream/stream.js
*
*/
// Browser-Optimized Imports (Don't directly import the URLs below in your application!)
export * from '/-/@thi.ng/[email protected]/dist=es2019,mode=imports/optimized/@thi.ng/rstream/stream.js';
export {default} from '/-/@thi.ng/[email protected]/dist=es2019,mode=imports/optimized/@thi.ng/rstream/stream.js'; I tried manually adding |
@snosenzo Also hmmm.... this might explain the issue: skypackjs/skypack-cdn#365 - looks like this whole CDN project is possibly abandoned (and hence maybe also no ES2022 support???), but no official word to be found and I'm personally not really using it (so didn't notice so far....) |
@snosenzo I think I will switch all docs to use https://www.jsdelivr.com. So you just need to replace: https://cdn.skypack.dev/@thi.ng/rstream ...with: https://esm.run/@thi.ng/rstream (A quick look at the returned code there, it seems they thankfully don't mess around with transpilation to older syntax, at least not in the above way...) |
@postspectacular
Also yeah, first time trying to use the skypack version. |
Getting this error when trying to use
stream
orreactive
in the skypack build:Example jsfiddle here:
https://jsfiddle.net/snosenzo/qnub2acg/91/
I think it's an issue with the build because the source code around the error looks like:
![image](https://private-user-images.githubusercontent.com/10187776/323040063-bab5d3ad-7f31-4ca1-ad37-594ad48400e9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzE2ODEsIm5iZiI6MTczODk3MTM4MSwicGF0aCI6Ii8xMDE4Nzc3Ni8zMjMwNDAwNjMtYmFiNWQzYWQtN2YzMS00Y2ExLWFkMzctNTk0YWQ0ODQwMGU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDIzMzYyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzNGNkYzU1YTZjZjEzZGU3MTcyZjNlYzZiNjQ5ZmE0MzE3OTBiYjNmNDhmNGQyZmUwMDBiOTJiMTc5YzQ1YzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.UPp_cUnd5xd04YPQgcnKOZj83MJm_EOcdQVNI2UzDmA)
which would mean it is indeed using
this
before callingsuper
.Maybe it's a jsfiddle issue? Open to hear if I'm doing anything incorrect.
The text was updated successfully, but these errors were encountered: