question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source maps point to non existent files

See original GitHub issue

Intended outcome:

Sourcemaps are detected and used correctly. Actual outcome: When building a typescript project that uses apollo with source maps, webpack produces the following outpùt:

WARNING in ./node_modules/apollo-client/util/Observable.js
Module Warning (from ./node_modules/source-map-loader/index.js):
(Emitted value instead of an instance of Error) Cannot find source file '../../src/util/Observable.ts': Error: Can't resolve '../../src/util/Observable.ts' in 'C:\Users\biel\projects\MS\Inv\invoices\invoices-app\node_modules\apollo-client\util'
 @ ./node_modules/apollo-client/core/ObservableQuery.js 21:0-48 419:2-12
 @ ./node_modules/apollo-client/index.js
 @ ./src/core/data/client.ts
 @ ./src/index.tsx
 @ multi ./src/index.tsx webpack-hot-middleware/client

WARNING in ./node_modules/apollo-client/ApolloClient.js
Module Warning (from ./node_modules/source-map-loader/index.js):
(Emitted value instead of an instance of Error) Cannot find source file '../src/ApolloClient.ts': Error: Can't resolve '../src/ApolloClient.ts' in 'C:\Users\biel\projects\MS\Inv\invoices\invoices-app\node_modules\apollo-client'
 @ ./node_modules/apollo-client/index.js 6:0-42 8:0-24 9:15-27
 @ ./src/core/data/client.ts
 @ ./src/index.tsx
 @ multi ./src/index.tsx webpack-hot-middleware/client

(and many more)

How to reproduce the issue: Download the package from npm and check that index.js.map has the following content: {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EACL,eAAe,GAIhB,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,YAAqC,MAAM,gBAAgB,CAAC;AAInE,8CAA8C;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,eAAe,YAAY,CAAC"} Note the ../src/index.ts which ipoints to a file that doesn’t exist. The package does not contain an src directory at all. My guess is that sourcemaps should either be self-contained or the src folder should be included to the npm package.

Versions

  System:
    OS: Windows 10
  Binaries:
    Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
  npmPackages:
    apollo-cache-inmemory: ^1.2.5 => 1.2.5
    apollo-client: ^2.3.5 => 2.3.5
    apollo-link: ^1.2.2 => 1.2.2
    apollo-link-error: ^1.1.0 => 1.1.0
    apollo-link-http: ^1.5.4 => 1.5.4
    react-apollo: ^2.1.9 => 2.1.9

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:41
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
maclockardcommented, Jul 31, 2020

Source maps still point to non existent files as of @apollo/client 3.1.0

5reactions
klemenoslajcommented, Feb 25, 2019

I have the same issues with Angular CLI, or even with a clean webpack/typescript project. Is there any plan to fix that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source maps reference non existent source file - Stack Overflow
This error is caused by the Kendo UI module's source map referencing a relative path that does not exist.
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
Missing or incorrect source map directive · Missing original source files · Bad source maps caused by multiple transformations · Files are ...
Read more >
Source maps for JavaScript · Raygun Docs
If you do not wish to have publicly accessible JavaScript files you can upload them directly to Raygun from the JS Source Map...
Read more >
Unable to set correctly sourcemaps files - Browser
But when trying to check on Error Instance tab no sourcemap was applied. Some points: Mapping is working when do drag-and-drop .map file...
Read more >
SourceMap - HTTP - MDN Web Docs
The SourceMap HTTP response header links generated code to a source ... (to the request URL) or absolute URL pointing to a source...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found