Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.8 => 3.0.10 Error: Could not find source map for: "...\validationHelper.ts" #245

Closed
baywet opened this issue Jan 29, 2018 · 16 comments
Closed
Labels

Comments

@baywet
Copy link

baywet commented Jan 29, 2018

Hi,
We were blocked from upgrading to 3.0.9 because of this one #226
I just tried upgrading to 3.0.10 and I'm getting a lot of errors like that.

Error: Could not find source map for: "...\subcontrols\peoplepicker\configuration\index.ts"
    at CoverageTransformer.addFileCoverage (...\node_modules\remap-istanbul\lib\CoverageTransformer.js:171:18)
    at ...\node_modules\remap-istanbul\lib\CoverageTransformer.js:298:14
    at Array.forEach (native)
    at CoverageTransformer.addCoverage (...\node_modules\remap-istanbul\lib\CoverageTransformer.js:296:24)
    at ...\node_modules\remap-istanbul\lib\remap.js:51:13
    at Array.forEach (native)
    at Reporter.remap (...\node_modules\remap-istanbul\lib\remap.js:50:16)
    at ...\node_modules\karma-typescript\dist\karma\reporter.js:38:42
    at Array.forEach (native)
    at Collection.forEach (...\node_modules\karma\lib\browser_collection.js:93:21)
    at Reporter.create.onRunComplete (...\node_modules\karma-typescript\dist\karma\reporter.js:26:26)
    at Server.<anonymous> (...\node_modules\karma\lib\events.js:13:22)
    at emitTwo (events.js:111:20)
    at Server.emit (events.js:194:7)
    at emitRunCompleteIfAllBrowsersDone (...\node_modules\karma\lib\server.js:295:12)
    at Server.<anonymous> (...\node_modules\karma\lib\server.js:326:7)

[reporter.karma-typescript]: TypeError: Cannot read property 'text' of undefined

Might be relate to that #240

@mquireyns
Copy link

mquireyns commented Jan 29, 2018

I get the same error when upgrading from 3.0.8 to 3.0.10.
You should be able to reproduce it with this: https://github.com/MrMosterd/bugreport1

@johnny-mh
Copy link

I have same issue. covered line are mismatched.

@coltonmercurio
Copy link

coltonmercurio commented Jan 30, 2018

Confirming the same issue.

@erikbarke erikbarke added the bug label Jan 30, 2018
@erikbarke
Copy link
Collaborator

It works if I lock down remap-istanbul to v0.8.4 😞

@erikbarke
Copy link
Collaborator

The culprit is a regex in remap-istanbul that doesn't match the inline source maps from karma-typescript: SitePen/remap-istanbul#149. I'll cut a panic release today with '[email protected]'...

erikbarke pushed a commit that referenced this issue Jan 30, 2018
@erikbarke
Copy link
Collaborator

v3.0.11 is on npm now 😊

@rolandjitsu
Copy link

rolandjitsu commented Jan 30, 2018

😄 now this is back:

30 01 2018 10:44:34.273:ERROR [karma]: TypeError: sourceMap.originalPositionFor is not a function
    at getMapping (/Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/getMapping.js:27:26)
    at getMappingResolved (/Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/CoverageTransformer.js:204:46)
    at remapBranch (/Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/remapBranch.js:14:19)
    at /Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/CoverageTransformer.js:214:44
    at Array.forEach (<anonymous>)
    at CoverageTransformer.addFileCoverage (/Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/CoverageTransformer.js:210:42)
    at /Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/CoverageTransformer.js:268:14
    at Array.forEach (<anonymous>)
    at CoverageTransformer.addCoverage (/Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/CoverageTransformer.js:266:24)
    at /Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/remap.js:48:13
    at Array.forEach (<anonymous>)
    at Reporter.remap (/Users/agroza/Projects/@bbpviz/utils/node_modules/remap-istanbul/lib/remap.js:47:16)
    at /Users/agroza/Projects/@bbpviz/utils/node_modules/karma-typescript/dist/karma/reporter.js:38:42
    at Array.forEach (<anonymous>)
    at Collection.forEach (/Users/agroza/Projects/@bbpviz/utils/node_modules/karma/lib/browser_collection.js:93:21)
    at Reporter.create.onRunComplete (/Users/agroza/Projects/@bbpviz/utils/node_modules/karma-typescript/dist/karma/reporter.js:26:26)
npm ERR! code ELIFECYCLE

Removing all the installed packages does not help.

@erikbarke
Copy link
Collaborator

I'm working on a fix in #246, feel free to try it out!

@baywet
Copy link
Author

baywet commented Jan 30, 2018

I can confirm that 3.0.11 workarounds this final issue and allows us to be back on latest version. Thanks guys!

@erikbarke
Copy link
Collaborator

Ok, so 3.0.11 works for you @baywet, but not for you @rolandjitsu? My guess is using different versions of npm gives different results now because of the source-map dependency in remap-istanbul, as described in #240. It would be really helpful if you guys could verify that PR #246 works for both of you!

@baywet
Copy link
Author

baywet commented Jan 31, 2018

on my local machine node 7.10.0
on the build agent 8.9.1
both work with 3.0.11
all on windows
the fix you authored seems to be working properly on my machine (pulled your branch, npm i, gulp build, npm link and npm link karma-typescript in my repo, let me know if I missed something)

@rolandjitsu
Copy link

I'm running on OS X Sierra, node 8.4, npm 5.6. I've been using Yarn to install the packages though. Might be because of that. I've switched to jest for now, but I will try the PR out on some other projects where I still use karma.

@TimothyMischief
Copy link

TimothyMischief commented Feb 1, 2018

Jumping into say I'm on 3.0.11 and getting the same error as @rolandjitsu (as below from my machine.)

I found this which seems to be tackling a similar problem and was resolved by moving to [email protected] https://github.com/apache/metron/pull/908

I've tried using yarn resolutions to override the dependency but it's not playing nice for some reason. I'll keep trying and report back.

UPDATE: got resolutions working, forcing remap-istanbul to v0.9.6 has solved it for me.

Error on my machine (before remap-instanbul resolutions solve):

    at getMapping (/Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/getMapping.js:27:26)
    at getMappingResolved (/Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/CoverageTransformer.js:204:46)
    at remapBranch (/Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/remapBranch.js:14:19)
    at /Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/CoverageTransformer.js:214:44
    at Array.forEach (native)
    at CoverageTransformer.addFileCoverage (/Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/CoverageTransformer.js:210:42)
    at /Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/CoverageTransformer.js:268:14
    at Array.forEach (native)
    at CoverageTransformer.addCoverage (/Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/CoverageTransformer.js:266:24)
    at /Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/remap.js:48:13
    at Array.forEach (native)
    at Reporter.remap (/Users/tim/Dev/Holdings/node_modules/remap-istanbul/lib/remap.js:47:16)
    at /Users/tim/Dev/Holdings/node_modules/karma-typescript/dist/karma/reporter.js:38:42
    at Array.forEach (native)
    at Collection.forEach (/Users/tim/Dev/Holdings/node_modules/karma/lib/browser_collection.js:93:21)
    at Reporter.create.onRunComplete (/Users/tim/Dev/Holdings/node_modules/karma-typescript/dist/karma/reporter.js:26:26)```

@erikbarke
Copy link
Collaborator

@TimothyDespair, the PR #246 uses [email protected], does that branch work for you if you install it like baywet describes earlier in this thread?

@TimothyMischief
Copy link

@erikbarke Just gave it a shot. Seems to be working!

@erikbarke
Copy link
Collaborator

Awsesome guys, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants