jfmengels / node-elm-review

CLI for elm-review
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Error on first time running elm-pages #319

Open arkaitz-dev opened 4 days ago

arkaitz-dev commented 4 days ago

elm-pages dev elm-pages dev server running at http://localhost:1234 Ran in 2ms /elm.js Ran elm-review in 252ms -- UNEXPECTED ERROR --------------- /home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-pages/generator/review/elm.json I ran into an unexpected error. Please open an issue at the following link: https://github.com/jfmengels/node-elm-review/issues/new

Please include this error message and as much detail as you can provide. If you can, please provide a setup that makes it easy to reproduce the error. That will make it much easier to fix the issue.

Below is the error that was encountered.

/home/arkaitz/proyectos/elm/prueba_pages/elm-stuff/generated-code/jfmengels/elm-review/elm-pages/2.12.0/review-applications/59274e92599855caa16357e0a28a68ee.js:6089 var $jfmengels$elm_review$Review$Exceptions$isFileWeWantReportsFor = F2(function $jfm); ^

SyntaxError: Unexpected token ')' at wrapSafe (node:internal/modules/cjs/loader:1378:20) at Module._compile (node:internal/modules/cjs/loader:1428:41) at Module._extensions..js (node:internal/modules/cjs/loader:1548:10) at Module.load (node:internal/modules/cjs/loader:1288:32) at Module._load (node:internal/modules/cjs/loader:1104:12) at Module.require (node:internal/modules/cjs/loader:1311:19) at require (node:internal/modules/helpers:179:18) at loadCompiledElmApp (/home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-review/lib/load-compiled-app.js:28:10) at initWithoutWorker (/home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-review/lib/app-wrapper.js:110:21) at init (/home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-review/lib/app-wrapper.js:35:10) Trace: problem with format in reviewReportJsonString TypeError: Cannot read properties of undefined (reading 'length') at emptyReviewError (file:///home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-pages/generator/src/dev-server.js:613:55) at handleNavigationRequest (file:///home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-pages/generator/src/dev-server.js:461:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at emptyReviewError (file:///home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-pages/generator/src/dev-server.js:615:15) at handleNavigationRequest (file:///home/arkaitz/.nvm/versions/node/v20.18.0/lib/node_modules/elm-pages/generator/src/dev-server.js:461:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Ran in 261ms /content.dat

lishaduck commented 3 days ago

@jfmengels, would you agree that this looks suspiciously like #313?

Perhaps it's an existing race condition that the promise work I did exacerbated?

jfmengels commented 3 days ago

Hi @arkaitz-dev

Even though it does literally say to open an issue here, I think the issue probably lies with elm-pages somehow (which uses elm-review). cc @dillonkearns I'm not sure what the cause may be. It looks like the compiled output was cut off somehow.

jfmengels commented 3 days ago

@lishaduck It's possible, yes.

lishaduck commented 3 days ago

Took a closer look. The stacktrace is the same (it's wrapped with a bunch of elm-pages traces and has esm loader stuff (b/c elm-pages is esm?) but it looks the same to me, so I'll work on reproing it again.