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

ArgumentError in Surface.API.generate_docs when compiling a component with @moduledoc false #85

Closed
Blond11516 opened this issue May 21, 2020 · 1 comment

Comments

@Blond11516
Copy link
Contributor

When building a project that contains any Surface component (i.e. any module using Component, LiveView, LiveComponent or MacroComponent) with @moduledoc false, compilation fails with the following error:
image

Expected Behavior

The project should compile successfully.

Current Behavior

Compilation fails.

Possible Solution

Adding the following arm to the case statement of Surface.API.generate_docs/1 appears to fix the issue:

{_line, false} ->
  {env.line, props.doc}

This solution returns the same doc as if the @moduledocattribute was not specified at all.

Steps to Reproduce

  1. Create a mix project
  2. Add Surface as a dependency
  3. Create a module with using Surface.Component and @moduledoc false
  4. Run mix compile

Context (Environment)

Elixir version: 1.10.3-otp-22
Surface version: Latest from master

If this an actual issue and the proposed solution is acceptable I would be happy to submit a PR to fix this!

@msaraiva
Copy link
Member

Fixed in b18a1ad.

Thanks for reporting this issue!

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

No branches or pull requests

2 participants