examples icon indicating copy to clipboard operation
examples copied to clipboard

feat: Photo storage example

Open sea-snake opened this issue 2 years ago • 1 comments

Example React application that shows how to upload files to an assets canister with the @dfinity/assets package.

Related PR https://github.com/dfinity/agent-js/pull/603

sea-snake avatar Sep 27 '22 00:09 sea-snake

Thank you very much for this PR! I'd like to get back to this once https://github.com/dfinity/agent-js/pull/603 is merged. Feel free to ping me when you think I should take another look

sesi200 avatar Sep 28 '22 11:09 sesi200

Updated MR with above suggestions and fixed some bugs (replaced masonry dep with a more reliable masonry dep)

sea-snake avatar Oct 23 '22 00:10 sea-snake

Looking nice, thanks a lot! Any chance you can also add a very basic e2e test to alert us (me) when a dfx update breaks the example? This is a good example you could work from. It doesn't need to be anything fancy

sesi200 avatar Nov 03 '22 12:11 sesi200

Also, the rust-basic-bitcoin failed test will be fixed in master in a few minutes

sesi200 avatar Nov 03 '22 12:11 sesi200

Looking nice, thanks a lot! Any chance you can also add a very basic e2e test to alert us (me) when a dfx update breaks the example? This is a good example you could work from. It doesn't need to be anything fancy

Added a workflow that checks if the project builds and deploys successfully.

sea-snake avatar Dec 10 '22 23:12 sea-snake

With npm i and npm run build I get the following error:

Failed to compile.

Module not found: Error: Can't resolve 'assert' in '/Users/ssiff/Desktop/examples/hosting/photo-storage/node_modules/@dfinity/identity/lib/esm/identity'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }

Is this a problem introduced by myself or something wrong with the code?

sesi200 avatar Dec 12 '22 10:12 sesi200

Is this a problem introduced by myself or something wrong with the code?

Seems like a problem in @dfinity/identity 0.14.1, updating dependencies to 0.15.0 seems to fix it.

sea-snake avatar Dec 14 '22 10:12 sea-snake

Thank you for fixing it that quickly! Can confirm it work now. Thank you very much for contributing!

sesi200 avatar Dec 15 '22 10:12 sesi200