Source maps point to non existent files
See original GitHub issueIntended 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:
- Created 5 years ago
- Reactions:41
- Comments:23 (3 by maintainers)
Top GitHub Comments
Source maps still point to non existent files as of @apollo/client 3.1.0
I have the same issues with Angular CLI, or even with a clean webpack/typescript project. Is there any plan to fix that?