Giter Site home page Giter Site logo

Error related to debug mode? about elm-watch HOT 9 CLOSED

lydell avatar lydell commented on July 28, 2024
Error related to debug mode?

from elm-watch.

Comments (9)

Odalrick avatar Odalrick commented on July 28, 2024 1

I got back and deleted the elm-stuff directoty, and it started working again. :)

I have the crashing file saved, but I don't suppose there is much point in posting it.

The tool itself looks great. Do one thing, and do it well. I'll configure the rest to work with my set up. 👍

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Hi!

I can't figure out what this error is telling me.

There was a crash in Elm’s compiled JS. That is not supposed to happen. Most likely it’s due to a bug in elm-watch triggered by some piece in your Elm code that I have never thought of before. It could also be due to a postprocess script. Do you use the “postprocess” feature of elm-watch?

I cant really see a way to "turn debug mode off" though.

It’s currently not possible to switch compilation mode when the app fails to initialize. (Maybe I can improve that, though.) A workaround is to delete elm-stuff/elm-watch/stuff.json, restart elm-watch and refresh the page.


Would you be able to share the broken cart-widget.elm.js with me somehow? Then I could debug it.

from elm-watch.

Odalrick avatar Odalrick commented on July 28, 2024

Would you be able to share the broken cart-widget.elm.js with me somehow?

Yes, on Monday, when I get back to the computer.

And no postprocess script. I was thinking of adding one to see if that helped work around this bug, but never got that far.

The only thing I can think of that's vaguely unique is having many instances of the same app running, but that's never been a problem before. Besides, that's not the app that's crashing; it's a Platform.worker. It doesn't have any UI.

I'm planning on moving it to a web worker, mostly to handle multiple tabs.

from elm-watch.

Odalrick avatar Odalrick commented on July 28, 2024

This is the elm-watch.json.

{
  "targets": {
    "CartWidget": {
      "inputs": ["elm/CartWidget.elm", "elm/CartViews.elm"],
      "output": "public/js/cart-widget.elm.js"
    },
    "AdminOrder": {
      "inputs": ["elm/AdminOrder.elm"],
      "output": "public/js/admin-order.js"
    },
    "BookingWidget": {
      "inputs": ["elm/BookingWidget.elm"],
      "output": "public/js/booking-widget.elm.js"
    }
  },
  "port": 44331
}

Never got around to trying the other targets.

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Which of the .elm files contains the Platform.worker? CartWidget.elm?

Not that you are not even supposed to be able to switch to debug mode for workers:

image

Edit: I managed to reproduce it now. It happens when one input (CartWidget.elm) is a Platform.worker and another input (CartViews.elm) is Browser.element, of the same target. Then it’s possible to enable the debugger (since one of the inputs can use it), but it causes a crash. Good catch!

from elm-watch.

Odalrick avatar Odalrick commented on July 28, 2024

Interesting. The way I usually build, the way I want to replace, is an npm script:

"elm-live elm/CartWidget.elm elm/CartViews.elm --no-server -- --debug --output=public/js/cart-widget.elm.js",

I wonder why that's never been a problem before.

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Because you weren’t using elm-watch :) elm-watch has its own hot reloading implementation, and I introduced a bug when programs that do and do not support the debugger are bundled in the same output.

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Great, I’ll try to fix the bug soon!

from elm-watch.

lydell avatar lydell commented on July 28, 2024

Fix released in v1.1.1.

from elm-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.