Showing posts with label PlayFramework. Show all posts
Showing posts with label PlayFramework. Show all posts

Wednesday, November 02, 2016

IntelliJ Ultimate Debugging JavaScript from the LightBend Activator/Play Framework

Symptom

You tried to debug a {java | type|}script in Chrome browser and it does not fire a breakpoint.

You have already made sure that JetBrain extension is installed in Chrome and configured right.

You've also added the JavaScript debugging configuration, and the web page launches (e.g., http://localhost:9000)

Fix

There is one more missing piece to this puzzle. You need to map the URL for where the scripts come from. This is clearly documented in the IntelliJ documentation, but nevertheless, it is not intuitive enough that it took a while for me to find out.

The key is that you need to type in the Remote URL in the Remote URL list. This is NOT OPTIONAL for Play users. If you are running the "out of the box" configuration of Play framework, and putting in your *.js under the "public" directory somewhere, then all you need to do is to just type in /assets (will become http://assets after you save it without any ill effect) where the public folder is in the list. Save it and any JavaScript or Typescript (with a map) can be debugged.

Enjoy!





Sunday, May 24, 2015

IntelliJ IDEA 14.x How To Resolve "routes" Activator/Play Object

Problem:

You just imported the SBT project of Activator or Play framework app in IntelliJ IDEA (14), and you found that you "routes" among other symbols do not resolve.

Root Cause:

You are lacking the dependency for the auto-generated routing class.

Solution:

You can add Module Dependency to classes_managed. This is located in the target/scala_2.xx/classes_managed

I originally posted a similar solution, but this one is much better and works with Play 2.3 or later. This video shows you exactly what you will need to do.