mdgriffith / elm-optimize-level-2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: expected number of arguments=256 but got 0 in /dist/transforms/patterns.js:24:31

tad-lispy opened this issue · comments

It looks similar to #52 but I thought it's better to open a separate issue. Here's the whole output:

Error: something went wrong, expected number of arguments=256 but got 0 for step
    at Object.exports.matchWrappedInvocation (/home/tad/Projects/software-garden/client-dashboard/node_modules/elm-optimize-level-2/dist/transforms/patterns.js:24:31)
    at collectFunctions (/home/tad/Projects/software-garden/client-dashboard/node_modules/elm-optimize-level-2/dist/transforms/passUnwrappedFunctions.js:19:43)
    at visitNodes (/home/tad/Projects/software-garden/client-dashboard/node_modules/typescript/lib/typescript.js:74866:48)
    at Object.visitEachChild (/home/tad/Projects/software-garden/client-dashboard/node_modules/typescript/lib/typescript.js:75096:156)
    at collectFunctions (/home/tad/Projects/software-garden/client-dashboard/node_modules/elm-optimize-level-2/dist/transforms/passUnwrappedFunctions.js:58:41)
    at visitNode (/home/tad/Projects/software-garden/client-dashboard/node_modules/typescript/lib/typescript.js:74815:23)
    at Object.visitEachChild (/home/tad/Projects/software-garden/client-dashboard/node_modules/typescript/lib/typescript.js:75168:46)
    at collectFunctions (/home/tad/Projects/software-garden/client-dashboard/node_modules/elm-optimize-level-2/dist/transforms/passUnwrappedFunctions.js:58:41)
    at visitNodes (/home/tad/Projects/software-garden/client-dashboard/node_modules/typescript/lib/typescript.js:74866:48)
    at Object.visitEachChild (/home/tad/Projects/software-garden/client-dashboard/node_modules/typescript/lib/typescript.js:75146:45)

We are using Elm Optimize Level 2 as part of Elm Pages. The problem appeared today after merging a branch in our project. We can still build a previous version, so it must be something in our code that triggers the error.

I'll go commit by commit and try to isolate the problem.

@SamRPhillips and I found that the bug is triggered by using SHA256 or any other module from https://github.com/folkertdev/elm-sha2.

We prepared a minimal reproducible example here https://gitlab.com/software-garden/elm-optimize-level-2-sha-bug.

Just guessing, but it seems like the digits at the end of module name trigger it.

I believe this will be fixed by #91.

Thanks @lydell. Good to know it's already on the workbench.

I confirm that #91 should fix the issue. The description of the problem very much fit what I have found to be the issue.

This bug has been fixed. This issue should therefore be closed.