-
Notifications
You must be signed in to change notification settings - Fork 14
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
'import' and 'export' may appear only with 'sourceType: module' #15
Comments
Removing this line from reconnecting-websocket's package.json fixes the problem:
I think I might need to report this upstream. I'll note that building hyperswarm-web by itself works regardless, and I can run test.js. It's when I try to integrate it into a larger project that this comes up. |
Reported upstream here: |
Thanks for the report! This sounds like an upstream thing. 😅 I'll subscribe to it and update the deps when it's fixed. |
What are you using to build the project by the way? |
@RangerMauve I can't say I'm great with Node stuff yet, and thankfully I wasn't the one who had to put together the build process. But, ultimately, this is the end of the chain: https://github.com/KyleMaas/ssb-browser-demo/blob/add-dht-support-runnable/package.json (That's a development branch for the new feature that would use this so people can test it out.) That, several layers of dependencies deep, depends on this: https://github.com/staltz/multiserver-dht/blob/master/package.json We're still working on this whole process, but so far it's been quite promising. Right now we're using this as a workaround: https://github.com/KyleMaas/ssb-browser-core/blob/add-dht-support-runnable/package.json#L49 Basically, it gets rid of the "module" line post-install, which makes everything hunky-dory. But ultimately it'd be much better if we didn't have to do that. |
Hey @KyleMaas, how are you?
Since building the module isolated works ok, could be possible that there is a missing configuration somewhere on top.
I try to do a
|
@tinchoz49 As far as I can tell, the problem seems to come in when built using browserify, which is what ssb-browser-demo (the package at the end of the chain) uses. Each step up the chain seemed to build fine until I tried building ssb-browser-demo, so I have to assume it's somewhere in that step. Past that, unfortunately, I can try to help find information if given direction, but I just don't really have the skills to debug it myself. I'm an old-school JavaScript guy who shunned JQuery for years for being an unnecessary dependency when raw DOM was perfectly adequate. And even then, it's been years since I've done much with JavaScript at all. So being thrust into the world of npm is exceedingly unfamiliar territory for me. More than happy to help, but my skill level with the build tools is very low. |
Ah thanks for the catch up, I will take a look in that project. |
If you want to try it, you'll need to try this branch: https://github.com/KyleMaas/ssb-browser-demo/tree/add-dht-support-runnable ...which uses this branch of ssb-browser-core with this line of workaround postinstall script: https://github.com/KyleMaas/ssb-browser-core/blob/add-dht-support-runnable/package.json#L49 Try it without the "sed" commands to see the error pop up. |
I'll note that the rest of that postinstall script is still needed, because ssb-dht-invite still has to be compiled from TypeScript - the package doesn't seem to contain the compiled version. |
I'm getting this error during the:
|
Ah, sorry. Old version of a dependency was pinned in npm-shrinkwrap. Just pushed a new commit that should fix that. Please give it another try. |
That works thanks. I try Before that I build ssb-browser-core without the postinstall workaround for reconnecting-websocket. |
Has this been resolved? |
Unfortunately, it does not appear fixed. The error does not show up when ssb-browser-core is built by itself. Only when it is built into ssb-browser-demo. I've made a branch to try to demonstrate it better: https://github.com/KyleMaas/ssb-browser-demo/tree/add-dht-support-runnable-broken I'm having some issues with sodium at the moment, which is throwing this off a bit for me. But this error still exists. Hopefully this branch will help duplicate it for you. |
Here is a copy of the error (base path removed). |
We revisited DHT again and still had this problem. The way we worked around it is to patch reconnecting-websocket with a postinstall script, and that works now and is in mainline for ssb-browser-demo. So if you want to duplicate this, download mainline ssb-browser-demo, remove the postinstall script from package.json, and try building. |
Getting an error trying to build this:
The text was updated successfully, but these errors were encountered: