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

Encountered an error when parsing component #35

Open
adheus opened this issue Jul 24, 2020 · 2 comments
Open

Encountered an error when parsing component #35

adheus opened this issue Jul 24, 2020 · 2 comments
Labels
brs Root cause is in the brs intepreter

Comments

@adheus
Copy link

adheus commented Jul 24, 2020

Hi, I'm trying to run roca on my project but the following error is raised:

Interpreter found an error:  Error: Encountered an error when parsing component ButtonBar: TypeError [ERR_INVALID_URL]: Invalid URL: ButtonBar.brs
    at componentDefinitions.forEach (/Users/user/Projects/roca-test-roku/nod_modules/brs/lib/index.js:66:19)

This error is while it is trying to parse the ButtonBar.xml component from Roku SGDEX(https://github.com/rokudev/SceneGraphDeveloperExtensions/tree/master/extensions/SGDEX/ButtonBar).

Did I forget to do something or is there any way that I can skip that file?

@sjbarag
Copy link
Contributor

sjbarag commented Jul 24, 2020

Hey @adheus — thanks for the clear bug report! I suspect this is caused by the fact that SGDEX uses relative paths in its <script/> tags, but brs (the brightscript interpreter that roca runs in) doesn't support those yet. I'll file an issue over in that project to get that supported — hopefully we can get that released pretty soon 😅

In the meantime, you should be able to get around it by replacing the three relative path uri attributes in ButtonBar.xml with absolute paths (e.g. pkg:/path/to/ButtonBar.brs, pkg:/path/to/ContentManager/ContentManagerUtils.brs, and pkg:/path/to/Views/utils/Utils.brs). I know that's a pain to do repeatedly for all the SGDEX components, so hopefully this is a one-off change for now while we get relative paths supported upstream.

Sorry for the confusion!

@sjbarag sjbarag added the brs Root cause is in the brs intepreter label Jul 24, 2020
@adheus
Copy link
Author

adheus commented Jul 24, 2020

In case anyone wants to quickly port a project. I've created a Python script Gist to patch this(don't run this unless you can revert any changes):

https://gist.github.com/adheus/aed5d859da761f4f36e89998c4354b35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brs Root cause is in the brs intepreter
Projects
None yet
Development

No branches or pull requests

2 participants