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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elm code with Debug.log fails with Javascript error #8263

Closed
johnykifle opened this issue Jun 29, 2022 · 0 comments 路 Fixed by #8076
Closed

Elm code with Debug.log fails with Javascript error #8263

johnykifle opened this issue Jun 29, 2022 · 0 comments 路 Fixed by #8076

Comments

@johnykifle
Copy link

johnykifle commented Jun 29, 2022

馃悰 bug report

I have forgotten to delete the Debug.log code on elm and the build failed with javascript error.

Inside my elm code I had

 case x of 
   ...

  OnChange value ->
      let
          _ =
               Debug.log "Test" value
      in
      .....

馃帥 Configuration (.babelrc, package.json, cli command)

package.json

"devDependencies": {
        "@parcel/packager-raw-url": "^2.3.2",
        "@parcel/transformer-elm": "^2.3.2",
        "@parcel/transformer-webmanifest": "^2.3.2",
        "@vercel/node": "^1.15.0",
        "vercel": "^24.0.0"
    },

馃 Expected Behavior

Show error that the code is running with Debug and its not allowed?

馃槸 Current Behavior

@parcel/transformer-elm: Cannot read property 'flatMap' of undefined

  TypeError: Cannot read property 'flatMap' of
  undefined
      at Object.transform
  (/Users/{path/to/project}/node_modules/@parcel/transformer-elm/lib/ElmTransformer.js:170:48)
      at async Transformation.runTransformer
  (/Users/{path/to/project}//node_modules/@parcel/core/lib/Transformation.js:653:5)
      at async Transformation.runPipeline
  (/Users/{path/to/project}//node_modules/@parcel/core/lib/Transformation.js:402:36)
      at async Transformation.runPipelines
  (/Users/{path/to/project}//node_modules/@parcel/core/lib/Transformation.js:265:40)
      at async Transformation.run
  (/Users/{path/to/project}//node_modules/@parcel/core/lib/Transformation.js:183:21)
      at async Child.handleRequest
  (/Users/{path/to/project}//node_modules/@parcel/workers/lib/child.js:217:9)

馃拋 Possible Solution

Prevent building if there are any Debug

馃實 Your Environment

Software Version(s)
Parcel v2
Node v14.119.1
npm/Yarn Yarn v1.22.18
Operating System MacOs Monterey
@johnykifle johnykifle changed the title @parcel/transformer-elm: Cannot read property 'flatMap' of undefined Elm code with Debug.log fails with Javascript error Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants