fix: add sanity options from runtimeconfig to module defaults #319
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the docs for this module its says that you can also pass options through nuxt runtime configuration. This works as intended except when the proejctId is only specified in the runtime config. The config is validated bevor it is merged with option specified in the runtime config. Therefore, when the projectId is specified only in the runtime config the config is deemed invalid and the module won’t be initialized.
This problem could be solved if the options specified in runtime config are merged into the default options as shown in this pull request. I think this would also make this part redundant but I’m not sure.
Happy to hear your opinions on this topic!