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

Optimization fails for at least one project #52

Open
mdgriffith opened this issue Sep 2, 2021 · 1 comment
Open

Optimization fails for at least one project #52

mdgriffith opened this issue Sep 2, 2021 · 1 comment

Comments

@mdgriffith
Copy link
Owner

mdgriffith commented Sep 2, 2021

So, this doesn't seem to be very common, but someone ran into this error when optimizing their project:

Compiled, optimizing JS...
Error: something went wrong, expected number of arguments=1 but got 4 for h0
    at Object.exports.matchWrappedInvocation (/opt/homebrew/lib/node_modules/elm-optimize-level-2/dist/transforms/patterns.js:24:31)
    at collectFunctions (/opt/homebrew/lib/node_modules/elm-optimize-level-2/dist/transforms/passUnwrappedFunctions.js:19:43)
    at visitNode (/opt/homebrew/lib/node_modules/elm-optimize-level-2/node_modules/typescript/lib/typescript.js:74815:23)
    at Object.visitEachChild (/opt/homebrew/lib/node_modules/elm-optimize-level-2/node_modules/typescript/lib/typescript.js:75168:46)
    at collectFunctions (/opt/homebrew/lib/node_modules/elm-optimize-level-2/dist/transforms/passUnwrappedFunctions.js:58:41)
    at visitNodes (/opt/homebrew/lib/node_modules/elm-optimize-level-2/node_modules/typescript/lib/typescript.js:74866:48)
    at Object.visitEachChild (/opt/homebrew/lib/node_modules/elm-optimize-level-2/node_modules/typescript/lib/typescript.js:75146:45)
    at collectFunctions (/opt/homebrew/lib/node_modules/elm-optimize-level-2/dist/transforms/passUnwrappedFunctions.js:58:41)
    at visitNode (/opt/homebrew/lib/node_modules/elm-optimize-level-2/node_modules/typescript/lib/typescript.js:74815:23)
    at visitFunctionBody (/opt/homebrew/lib/node_modules/elm-optimize-level-2/node_modules/typescript/lib/typescript.js:74971:23)

So, something to do with tracking function arity somewhere.

I wonder how hard it would be to make it so that any given transformer will just report file coordinates, or even a file snippet when an error is encountered 🤔

@dillonkearns
Copy link

For visibility, #90 is also related.

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