Open TheDevKnight opened 3 years ago
Hi there @TheDevKnight, I will check it out. I think you need to enable source maps in latest Fable. Will try to see how to make it work and come back to you π
Hi @Zaid-Ajaj that would be great. Thank you βΊοΈ
Should be resolved by this PR https://github.com/Zaid-Ajaj/Feliz/pull/330
Sorry @roboz0r I rolled back the config in the template because of I changed webpack back to v4.x (due to #332) so this issue remains
I'm not a front-end developer - just played around with Feliz but I think I found a solution for this problem - it seems to work in my very simple use case:
Almost all of the #330 PR is relevant. I followed the following steps:
source-map-loader
in package.json
to ^1.1.3
.start
script has -s
parameter passed to dotnet fable
(it's already in the template).webpack.config.js
: pwsh ο git diff .\webpack.config.js
diff --git a/webpack.config.js b/webpack.config.js
index 54dbd73..a1a07ae 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -127,6 +127,11 @@ module.exports = {
// - file-loader: Moves files referenced in the code (fonts, images) into output folder
module: {
rules: [
+ {
+ test: /\.js$/,
+ enforce: "pre",
+ use: ["source-map-loader"],
+ },
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
This change fixes both the link in console logs in the browser and enabled me to debug in vscode against the F#
code.
In order to debug in VSCode you can just open the command pallet and select: Debug: Open Link
it will launch a debug session and offer to save a task. In my case it generated the following launch.json
file:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "msedge",
"name": "Web Debug",
"request": "launch",
"url": "http://localhost:8080/"
}
]
}
@Zaid-Ajaj , If you're ok with this change I can create a PR.
HTH.
Hi, would be very cool when you add the vs code settings for debugging with chrome. I have an app based on the template end get no working debugging experience π
Regards