A minimal config, with parcel and babel-preset-solid is not hitting debug break points. Tested in VSCode with Chromium and Firefox debugger.
Hmm.. Head scratcher. I don't really even know where to start on that one. I mean I have debugged in the browser with webpack and rollup with source maps with JavaScript. Babel produces standard source maps, so I'm unclear why VSCode or TypeScript would be any different.
My only thought is that the combination of TypeScript + Babel messes things up. I've tried to google it but I haven't found any references yet. All guides seem to be around debugging with TypeScript specifically, which likely doesn't apply here.
I guess the issue could be with parcel, not really sure. Does this work in webpack?
I can't claimed to have used VSCode with TypeScript with Webpack or Rollup to debug. But I use Parcel in CodeSandbox so I've debugged in the browser with JavaScript that way. The wildcards are definitely VSCode and TypeScript. I've been unsuccessful to date to getting a working TypeScript CodeSandbox Parcel+TypeScript build: https://codesandbox.io/s/solid-counter-ts-rzi8b. Maybe you can see what's wrong here. TypeScript just tests my patience a lot. I don 't use it in my own projects since I hit issues doing even the most inane things. It sort of just drives me nuts. I figure if we get Parcel and TypeScript debugging to work then we can look at VSCode last.
Maybe this could be connected?
https://github.com/parcel-bundler/parcel/issues/2023
Will take a look at codesandbox.
Did not manage to make it work, either. Adding Typescript as a dependency resolves the crash, but nothing gets rendered.
This atleast makes sense for the CodeSandbox issue.
@high1 not sure about parcel but vscode debugging is working with webpack.
For reference: https://github.com/atfzl/solid-ts-starter
Great, thanks. This most likely pinpoints the parcel as the issue here. I would not report this upstream, if @ryansolid agrees, as they are in the middle of the rewrite to Parcel 2.
Yeah I agree. It's a bit unfortunate but at least a solution is in sight. We really have no recourse beyond waiting it out. Thanks for shedding some light here. I'd been off and on trying to get a codesandbox with TypeScript and Parcel working for a couple months now.
Ultimately the reason we keep hitting issues like this Typescript's view of JSX is very narrow. Somehow TypeScript managed to exist with awkward flows with Babel for years only being remedied with Babel 7. That was the catalyst for me moving to TypeScript, but other tooling still needs to catch up. And TypeScript itself still has a long long way to go.
Well, I had very positive experiences on a larger scale project with TS, and would not want to go back.
Most helpful comment
@high1 not sure about parcel but vscode debugging is working with webpack.
For reference: https://github.com/atfzl/solid-ts-starter