-
Notifications
You must be signed in to change notification settings - Fork 42
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
Updating LinkedUp to work with 0.6.2 #39
Conversation
Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com>
webpack.config.js
Outdated
@@ -52,15 +48,7 @@ function generateWebpackConfigForCanister(name, info) { | |||
filename: "index.js", | |||
path: path.join(outputRoot, "assets"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I did something wrong, but I got this error when I tried opening the entrypoint in a browser (I did at least clear my cache):
An error happened:
http://localhost:8000/bootstrap.js:2:43236
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]
promiseReactionJob@[native code]
There are some more differences in the webpack.config.js for new projects that I don't see reflected here (though I don't know if they are required):
- entry using frontend.entrypoint
- output into a "dist" directory
- a corresponding assets
source
indfx.json
that looks like this:
"source": [
"src/linkedup_assets/assets",
"dist/linkedup_assets/"
],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I got the same error when pulling from this update. Interestingly, it worked without the change (to the assets directory) for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it worked for me too when we had "canisters/linkedup_assets/assets"
included..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. What's happening is webpack.config.js
is writing its output into canisters/linkedup_assets/assets
.
So it will work to put canisters/linkedup_assets/assets
back into sources
, because that's where webpack is putting the files, but that means dfx will use canisters/linkedup_assets/assets
as both a source and as a destination when "building" the assets. That might cause problems the second or third time a build is run (or it might "just work").
My understanding of how newly-created projects manage this:
- webpack.config.js writes its output into a dist directory
dfx new
adds this dist directory as a source
Copy assets from dist directory. Update readme with new dfx command steps.
* Refresh content for the LinkedUp readme * Fix typo in URL * Remove ADOC notation * Change dfx.json * fix travis.yml file * fix bootstrap.sh file * change path in bootstrap.sh file * Update .travis.yml Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com> * fix canister id * delete old encoding line * remove uneeded id line * remove ID line * delete unused crc8 python script Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com> Co-authored-by: Prithvi Shahi <50885601+p-shahi@users.noreply.github.com> Co-authored-by: Prithvi Shahi <prithvi@dfinity.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good once those two unused fields are removed from dfx.json
kk, I fixed the unused properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't wanna bulldoze, but I approve this PR!
No description provided.