Skip to content

twenties: Move setup script from boot file to run at install time ins… - #4271

Open
thyttan wants to merge 3 commits into
espruino:masterfrom
thyttan:twenties
Open

twenties: Move setup script from boot file to run at install time ins…#4271
thyttan wants to merge 3 commits into
espruino:masterfrom
thyttan:twenties

Conversation

@thyttan

@thyttan thyttan commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

…tead.

Comment thread apps/twenties/metadata.json Outdated
{ "name": "twenties.boot.js", "url": "boot.js" },
{ "name": "twenties", "url": "lib.js" }
{ "name": "twenties", "url": "lib.js" },
{ "name": "RAM", "content": "require('twenties').setup();" }

@thyttan thyttan Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried doing

{ "name": "RAM", "url": "setup.js" }

where setup.js would be

require('twenties').setup()

but then it couldn't access the twenties library that was just uploaded with this error

>��Uncaught ReferenceError: "twenties" is not defined
    at REPL (:1:9)
require(twenties).setup();;Bluetooth.println("OK")
        ^
>Uncaught ReferenceError: "twenties" is not defined
    at REPL (:1:9)
require(twenties).setup();;Bluetooth.println("OK")
        ^
>

@gfwilliams is that expected?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - I should have tested a bit more. Doing

    { "name": "RAM", "url": "setup.js", "evaluate":true }

works.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there might have been some quoting error in that code? Eg require(twenties).setup() should have been require('twenties').setup() - so I wonder where along the line that got lost?

thyttan added 2 commits June 28, 2026 00:06
It was: Error: App twenties's RAM has evaluate:true but is not valid JS expression
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

Successfully merging this pull request may close these issues.

2 participants