Closed xmaysonnave closed 4 years ago
3 -Do you have any plan to upgrade the whatwg-url version you are using ?
Yes. Hopefully before summer.
Did you exclude the lib from parsing, per the readme?
Thanks for your fast reply.
As a rule never do a technical report at the end of the day... :-) Yes you're right I've forgotten to exclude the lib yesterday while I did it a few weeks ago when I evaluated the lib however I made a step forward.
1 - I successfully build my app with universal-url-lite and a got it up and running. I'm quite happy with the reduced size. However, here is the problem I faced a few weeks ago. The following is running without issue.
npx browserify \
src/ipfs-uri.js \
-s IpfsUri \
-o build/plugins/ipfs/ipfs-uri.js \
--noparse="/work/tiddly/tiddlywiki-ipfs/node_modules/universal-url-lite/lite.js" \
|| exit 1
but relative url do not seems to work and this is an issue as my github travis will have some issues with that. When I do the following :
npx browserify \
src/ipfs-uri.js \
-s IpfsUri \
-o build/plugins/ipfs/ipfs-uri.js \
--noparse="node_modules/universal-url-lite/lite.js" \
|| exit 1
The build is crashing and I got that :
Error: Cannot find module './url-state-machine' from '/work/tiddly/tiddlywiki-ipfs/node_modules/universal-url-lite'
2 - Unable to build with native :
npx browserify \
src/ipfs-uri.js \
-s IpfsUri \
-o build/plugins/ipfs/ipfs-uri.js \
--noparse="/work/tiddly/tiddlywiki-ipfs/node_modules/universal-url-lite/lite.js" \
--noparse="/work/tiddly/tiddlywiki-ipfs/node_modules/universal-url-lite/native.js" \
|| exit 1
I tried with or without lite.js and native.js each time I got the same result :
TypeError: _universalUrl.URL is not a constructor
3 - I'm glad to know that you plan to upgrade the lib.
To summarize if I can solve the relative url issue it will be good for me. Would love to evaluate the native shim though.
Warmly
I made a step forward.
According to the following report the noparse option should have an absolute URL: https://github.com/browserify/browserify/issues/1308#issuecomment-114948552 With the $PWD my build is up and running. I need to qualify this solution on Travis though. Let's say that this problem is solved. Only the native issue remains.
Thanks
I finally found out why I got this exception. I successfully build and run the native implementation. The issue came from my build chain and the way TiddlyWiki loads its modules. Thanks for your support.
@stevenvachon
I was using previously whatwg-url and I try to reduce the overall size of my dapp.
1 - No issue to switch from whatwg-url to universal-url. My DApp is running correctly and the tests are running.
2 - I added the recommended snippet:
in my package.json and tried to build. It's crashing with the following output :
Not sure where this error is coming. Any help will be greatly appreciated.
3 -Do you have any plan to upgrade the whatwg-url version you are using ?
4 - Here is the project I try to migrate.
https://github.com/xmaysonnave/tiddlywiki-ipfs
Thanks