You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling my application with Parcel, the source maps do not indicate the state of the original file. I think the step shown is after the Babel step. This only seems to affect TypeScript files, my JavaScript builds are fine.
I am using Babel because I want to polyfill my code with CoreJS, I followed your docs to set this up. If there is a way to polyfill easily without using Babel I would be open to trying that.
🎛 Configuration
I've included a full repro repo below, but in summary:
I also can't put any breakpoints into this file as it seems to be using the original TypeScript file's breakpoint lines.
💁 Possible Solution
Not sure, it might be to do with my configuration but I have tried messing with the source map settings of both Babel and TypeScript to no avail.
🔦 Context
The repro I have attached below simulates what I have in my production app, this issue is preventing debugging which is super problematic for me and might require me to find an alternative to Parcel ( I have just moved from Webpack, which was way slower, so I'd rather not...)
Following @mischnic's suggestion on #6642, which pointed out that I missed replacing @babel/preset-env with @parcel/babel-preset-env has helped somewhat, however, I'm still having issues with TSX.
I get a partially transformed file, with the JSX converted already:
import React from "react";
import { render } from "react-dom";
var ReactApp = function ReactApp(_a) {
var id = _a.id;
return /*#__PURE__*/React.createElement("div", null, "App ", id !== null && id !== void 0 ? id : 'idk', " is rendering here");
};
export default (function (id) {
return render( /*#__PURE__*/React.createElement(ReactApp, {
id: id
}), document.getElementById(id));
});
I have got it to work by only using Babel and removing TSC from my workflow, which I guess is the way I need to do it from now on.
I still think there is an issue with using Babel and TSC together.
🐛 Bug report
When compiling my application with Parcel, the source maps do not indicate the state of the original file. I think the step shown is after the Babel step. This only seems to affect TypeScript files, my JavaScript builds are fine.
I am using Babel because I want to polyfill my code with CoreJS, I followed your docs to set this up. If there is a way to polyfill easily without using Babel I would be open to trying that.
🎛 Configuration
I've included a full repro repo below, but in summary:
.parcelrc
.babelrc
tsconfig.json
🤔 Expected Behavior
I should see this in the sourcemapped file:
😯 Current Behavior
Instead, I see this:
I also can't put any breakpoints into this file as it seems to be using the original TypeScript file's breakpoint lines.
💁 Possible Solution
Not sure, it might be to do with my configuration but I have tried messing with the source map settings of both Babel and TypeScript to no avail.
🔦 Context
The repro I have attached below simulates what I have in my production app, this issue is preventing debugging which is super problematic for me and might require me to find an alternative to Parcel ( I have just moved from Webpack, which was way slower, so I'd rather not...)
💻 Code Sample
Please see my repro environment here:
https://github.com/liam-careerhub/parcel-sourcemap-repro
🌍 Your Environment
Thanks for your help 👍
The text was updated successfully, but these errors were encountered: