Skip to content
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

Error ABLDR12: Error. 'build/scripts/common.js' doesn't have an exported default function. #233

Closed
Lumene98 opened this issue Feb 12, 2021 · 1 comment

Comments

@Lumene98
Copy link
Contributor

This is not a major issue, but when you have multiple files in the root of scripts/ and one doesn't have an export default(probably if it's the first identified by algob during the deploy, ex. in my case common.js was choosen before deploy.js) the command will fail. Obviously, you can still do yarn algob deploy scripts/deploy.js but it's just to clarify that. Solution would be to check scripts files for an export default or simply suggest the user to specify the deploy script, temporary solution is to have the deploy in the root of scripts and leave the others in a subfolder.

@ratik21
Copy link
Member

ratik21 commented Feb 12, 2021

Thanks for the info @Lumene98. However, we don't recommend putting other .js file within deploy scripts. So in order to use common.js, i would suggest to put it in /scripts/common/common.js. This is how the project structure could look like:

scripts/*.js // algob deploy: will deploy these files (in sorted order)
scripts/common/*.js // common files
scripts/transfer/*.js // files for RUN mode (to use with `algob run scripts/transfer/*.js..` )
...

Please let me know if that makes sense. Will check docs as well.

@ratik21 ratik21 closed this as completed Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants