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

M365 Builder indexOf error #2457

Closed
tankerkiller125 opened this issue Jun 21, 2023 · 10 comments · Fixed by #2724
Closed

M365 Builder indexOf error #2457

tankerkiller125 opened this issue Jun 21, 2023 · 10 comments · Fixed by #2724

Comments

@tankerkiller125
Copy link

tankerkiller125 commented Jun 21, 2023

Describe the bug
Adding the following to an existing dnscontrol domain file results in an indexOf error.

M365_BUILDER({
    initialDomain: 'example.onmicrosoft.com',
    autodiscover: true,
    dkim: true,
    mx: true,
    skypeForBusiness: true,
    mdm: true
  }),

I've also tried it with only the initialDomain set, and with and without the domainGuid.

The exact error is executing dnsconfig.js: Error: File example.com.js: TypeError: 'indexOf' is not a function

To Reproduce
Steps to reproduce the behavior:

  1. Create a dnsconfig.js file that uses require_glob('folder', false)
  2. Create the domain file, include the M365_BUILDER function
  3. Execute dnscontrol preview
  4. See error

Expected behavior
This error shouldn't happen

DNS Provider

  • Cloudflare

Additional context
The existing DNS records on the domain have the M365 records, we're just trying to use the M365 Builder instead to clean up the config and make life a little easier. I don't think that's in anyway what's causing a conflict or issue though.

Commenting out the builder and everything works perfectly fine, bring it back though and this error get spit out.

@tlimoncelli
Copy link
Contributor

Can you try this again with the v4.2.0 release? 354063c may have fixed this.

@tlimoncelli
Copy link
Contributor

@juliusrickert I believe you contributed the code. Can you take a look?

(I have a hunch that r should be var r around line 1700 but I'm no Javascript expert!)

@tlimoncelli
Copy link
Contributor

@tankerkiller125
Could you try using the code in this PR? #2724

@tankerkiller125
Copy link
Author

This seems to be fixed with the PR, not getting an error, and it published the M365 records successfully.

@tlimoncelli
Copy link
Contributor

Thanks, @tankerkiller125 !

@nikolamilekic
Copy link
Contributor

I get the same error with 4.9.0. It also goes away when I remove the M365 Builder. Same repro steps with one difference: I'm not using require_glob.

@Koopzington
Copy link

@nikolamilekic

The example in the docs is wrong.
apparently you need to pass the domain as first argument and the other options as second argument https://github.com/StackExchange/dnscontrol/blob/v4.11.0/pkg/js/helpers.js#L1709

@nikolamilekic
Copy link
Contributor

nikolamilekic commented Jun 13, 2024 via email

@cafferata
Copy link
Collaborator

Thanks @Koopzington for the feedback. I asked the author for clarification on the original implementation. See #3008

@nikolamilekic
Copy link
Contributor

Oh, I may have submitted a pull request fixing the examples too quickly then. For reference its #3009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants