Skip to content

chore: load templates with explicit extensions#125

Open
jonathansamines wants to merge 2 commits intoauth0:masterfrom
jonathansamines:chore/explict-template-extension
Open

chore: load templates with explicit extensions#125
jonathansamines wants to merge 2 commits intoauth0:masterfrom
jonathansamines:chore/explict-template-extension

Conversation

@jonathansamines
Copy link
Copy Markdown

@jonathansamines jonathansamines commented Apr 1, 2026

Description

I am trying to use this library in the context of expo server routes, which seems to use Metro's module resolution, which does introduce special asset extensions which change the way modules are loaded for certain extensions (including xml).

All of that is to say, that when someone tries to load this library in expo, you get this error:

Metro error: Unable to resolve module ./templates/encrypted-key.tpl.xml from /Users/jonathansamines/dev/my-app/node_modules/@authenio/xml-encryption/lib/utils.js:

None of these files exist:
  * encrypted-key.tpl.xml
  * node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml
  3 |
  4 | var templates = {
> 5 |   'encrypted-key': require('./templates/encrypted-key.tpl.xml'),
    |                             ^
  6 |   'keyinfo': require('./templates/keyinfo.tpl.xml'),
  7 | };
  8 |

I realize this library was probably not designed for environments such as expo, but I am pulling this library transitively in a way that it gets loaded but not used, so at least being able to load it would be nice.

References

N/A

Testing

All tests pass

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

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.

1 participant