-
Notifications
You must be signed in to change notification settings - Fork 492
Source map wrong for JS files #327
Comments
@azizghuloum To solve this I have to change devtool to 'source-map' in webpack-config-dev. I'd ejected the project before.
|
in
|
I am having this same issue (#440). But looks like this workaround won't work because I will have to change everytime I do I would have to change from Is there a workaround where I can create some config file in root of my project to solve this issue? |
@shobhitg As of create-react-app 2.1.0, it now supports TypeScript, is there a reason you cannot use that? |
@fc I had started my project a month before official CRA 2.1.0 came out. Things were going fine and I had no reason to budge until I hit this Also I heard there were some differences in I will give CRA 2.1.0 a shot. But don't know if there would be any hurdles in converting the project. But I really wish this |
I tried CRA 2.1.0. I ran |
It looks like the jsx file extension is supported according their source: |
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Didn't try. I think this is irrelevant. I have 5.6.0
Which terms did you search for in User Guide?
map source lines
Environment
npm ls react-scripts-ts
(if you haven’t ejected):react-scripts-ts@2.16.0
node -v
:v8.11.2
npm -v
:5.6.0
yarn --version
(if you use Yarn):1.5.1
npm ls react-scripts-ts
(if you haven’t ejected):Is this different from 1?
Then, specify:
Operating system:
Mac OS 10.13.3
Browser and version (if relevant):
Chrome 66
Steps to Reproduce
(Write your steps here:)
(I also added
"allowSyntheticDefaultImports": true
to tsconfig.json but that's irrelevant)Foo.tsx
containing:Use it from
App.tsx
and notice that the error line numbers and highlights in the browser are absolutely 100% correct (see screenshot).Foo.js
and restartyarn run start
.Expected Behavior
That the output error is in the exact same place.
Actual Behavior
The source maps are messed up and the highlighted lines is wrong. (see screenshot)
Reproducible Demo
It's pretty straightforward to produce. Available upon request. :-)
We have a huge project that we're migrating to typescript and not having source map along the trip will cause huge frustration.
Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: