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

multi_extract no function clause matching "def to_charlist(string) when is_binary(string)" #123

Open
kbrown-axio opened this issue Aug 29, 2023 · 3 comments

Comments

@kbrown-axio
Copy link

I'm seeing an unexpected behavior with a particular spreadsheet. Will updated as I discover possible if there is anything particular about this spreadsheet.

iex(3)> {:ok, tid} = Xlsxir.multi_extract(xlsx_file)
** (FunctionClauseError) no function clause matching in String.to_charlist/1

The following arguments were given to String.to_charlist/1:

    # 1
    %Xlsxir.XlsxFile{
      worksheet_xml_files: [
        %Xlsxir.XmlFile{
          name: "sheet4.xml",
          path: nil,
          content: "<?xml version=\"1.0\" encoding=\"UTF-8\" ...
        },
        %Xlsxir.XmlFile{
          name: "sheet1.xml",
          path: nil,
          content: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/ ...
        },
        %Xlsxir.XmlFile{
          name: "sheet2.xml",
          path: nil,
          content: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/ <> ...
        }
      ],
      shared_strings_xml_file: %Xlsxir.XmlFile{
        name: "sharedStrings.xml",
        path: nil,
        content: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<sst <> ...
      },
      styles_xml_file: %Xlsxir.XmlFile{
        
        ...

        F\"/><xcalcf:feature name=\"microsoft.com:LAMBDA_WF\"/><xcalcf:feature name=\"microsoft.com:ARRAYTEXT_WF\"/></xcalcf:calcFeatures></ext></extLst></workbook>"
      },
      styles: #Reference<0.253553389.3350331393.1920>,
      workbook: #Reference<0.253553389.3350331393.1922>,
      shared_strings: #Reference<0.253553389.3350331393.1915>,
      max_rows: nil,
      extract_to: :memory,
      extract_dir: nil,
      options: []
    }

Attempted function clauses (showing 1 out of 1):

    def to_charlist(string) when is_binary(string)

(elixir 1.15.4) lib/string.ex:2577: String.to_charlist/1
(xlsxir 1.6.4) lib/xlsxir/unzip.ex:70: Xlsxir.Unzip.validate_path_all_indexes/1
(xlsxir 1.6.4) lib/xlsxir/xlsx_file.ex:231: Xlsxir.XlsxFile.extract_all_xml_files/2
(xlsxir 1.6.4) lib/xlsxir/xlsx_file.ex:63: Xlsxir.XlsxFile.initialize/2
(xlsxir 1.6.4) lib/xlsxir.ex:229: Xlsxir.multi_extract/5
iex:3: (file)
@kbrown-axio
Copy link
Author

Update: Same behavior on new spreadsheet with 2 cells. So could be a dependency or environmental problem. 🤷

@kbrown-axio
Copy link
Author

Update: "path: nil" looks sus especially given:

Attempted function clauses (showing 1 out of 1):

def to_charlist(string) when is_binary(string)

(elixir 1.15.4) lib/string.ex:2577: String.to_charlist/1
(xlsxir 1.6.4) lib/xlsxir/unzip.ex:70: Xlsxir.Unzip.validate_path_all_indexes/1

@kbrown
Copy link

kbrown commented Sep 5, 2023

working now. errors are not informative if the application has not been started.

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