Comments (8)
I was initially quite opposed to the idea of changing the command that is invoked, tbh.
But I see your point and I'm going to play around with passing a --sourceMap
flag if the underlying executor supports it
from nx-console.
hey!
So I just did some more research. There actually aren't very many executors left that expose a --sourcemap
flag or something similar. You have to configure it yourself in the underlying tooling config, for example webpack or vite.
This means that I've chosen not to build logic that automatically generates source maps for those few executors that still support it. It's not worth the maintenance burden on the team & I want to reduce the amount of magic that happens.
I have, however, added a periodic notification when running targets through debugging. This means that users will find the root cause of their breakpoints not hitting faster (see the PR above).
I know this probably won't make you very happy, but since Nx is technology-agnostic, we can't assume too much about the things you're using and how to ensure debugging works.
Thanks :)
from nx-console.
If you add debugger;
to the code, the breakpoints hit, but they are hit in a js file in the dist. Then, there's also a suspicious line in the serve
now:
nx run myproj:build [existing outputs match the cache, left as is]
webpack-cli build --node-env=production
Looks like something is forcing a production build during serve
. I'm assuming this is what's leading the prod build and therefore berakpoints not working.
from nx-console.
Found the reason in #2042.
Sourcemaps should be enabled by default for any development configuration. With today's monitoring solutions available, it's also very beneficial to have hidden source maps generated for the underlying monitoring software. Making a change that makes debugging not work out of the box is completely counter-intuitive for why someone would want to use something like nx-console.
from nx-console.
Can you elaborate on how nx console is involved here? How could the IDE plugin generate source maps?
from nx-console.
Judging from the comment in the other issue, that seems to be the culprit. Whether that is an nx-console or an nx thing is beyond me. But, I do know that this was working perfectly fine so either nx-console did something or nx did something.
I haven't ever developed a plugin for a JetBrains IDE so I am not sure what the process is. But, I would imagine that the plugin is generating a profile/configuration to run the underlying project based on the project.json.
That configuration has arguments and properties. For example, angular cli has --source-map
. So, when you're generating the configuration, maybe throw that flag in?
The reason why I think this is more of an nx-console problem is that you get the below UI in WebStorm when you install nx-console:
![image](https://private-user-images.githubusercontent.com/19480392/324923842-43bcb6d8-9ab2-4b5e-8beb-19fac408487a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc5NjU0MzMsIm5iZiI6MTcxNzk2NTEzMywicGF0aCI6Ii8xOTQ4MDM5Mi8zMjQ5MjM4NDItNDNiY2I2ZDgtOWFiMi00YjVlLThiZWItMTlmYWM0MDg0ODdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA5VDIwMzIxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiYmU3ZGQ1OWM4MGUxMTFiMWY3ZjQwOGVlNDFiZTQ4YzA1MzUxZjU2YmQ3MzVhNzkyNGFjMGMzMGQyNWJjYjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.z4nLEPfCxfxXVMjUF-3nqJi-0uCUODLVcyRLKq1ITsk)
This implies that I am able to set a breakpoint and run the project if I chose to run the Debug profile. Even the console output says a debugger is attached. It's extremely misleading.
from nx-console.
Ultimately, we can't guarantee that whatever is run will have source maps. You can also run any arbitrary command through this debug button and those might not support source maps or be configured correctly. So while this should handle more use cases natively, it's no guarantee.
from nx-console.
I think this became an issue somewhere in NX 17 per this comment: #1967 (comment)
My guess is that the only reason why this used to work for me was because nx-console is expecting source maps to be there and nx decided to not generate them. So, adding the flag should be the fix.
from nx-console.
Related Issues (20)
- affected / run-many watch flag to match run's watch flag HOT 2
- Couldn't find any projects HOT 11
- nx generate process failed to launch HOT 2
- Adding @nrwl/nest dependency using nx console in vscode fails
- Nx console plugin for Webstorm not considering NX_DAEMON_SOCKET_DIR HOT 8
- Custom tasks won't start in VS Code ("There is no task provider registered for tasks of type "nx") HOT 3
- Nx Console 18 showing on Add dependency old @nrwl names HOT 1
- Cannot run NX Console after updating to v18.21.0 in VS Code HOT 2
- Intellij Idea with NX Console opens project.json with Data Editor and Viewer if form of a table HOT 3
- Rerunning a run-many task results in undefined command being run HOT 3
- Error running task: "version is longer than 256 characters" HOT 3
- Spaces being removed in generators parameters in UI HOT 10
- Cannot create nx Workspace HOT 1
- Cannot open generator UI in VSCode HOT 2
- Multiple terminal popups on Windows HOT 7
- "We couldn't find any projects in this workspace" HOT 2
- Windows: descriptions breaks the Generate UI HOT 1
- works if the project is in the root folder HOT 1
- [Jetbrains] Nx Console cannot run any task from IDE if there's a folder named `nx` in workspace root HOT 1
- Nx Console Generate (UI) tab displaying raw HTML instead of generator options UI in Webstorm HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx-console.