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

Warnings about missing source map files when used in ParcelJS + TypeScript project #202

Closed
mdenburger opened this issue Mar 11, 2020 · 4 comments · Fixed by #230
Closed

Comments

@mdenburger
Copy link

When use-http is used in a Parcel.js + TypeScript project, the build logs several warnings "could not load source file X in source map of node_modules/use-http/dist/Y"

To Reproduce
Create a new Parcel app with TypeScript that uses use-http:

  1. yarn init -y
  2. yarn add --dev parcel-bundler typescript
  3. add index.html:
<html>
<body>
  <script src="./index.ts"></script>
</body>
</html>
  1. add index.ts:
import useFetch from "use-http";

console.log('test', useFetch);
  1. Build and start:
    yarn run parcel index.html --open

Expected behavior
Parcel does not log any warnings.

Actual behavior
Parcel logs the following warnings:

⚠️  Could not load source file "../src/index.ts" in source map of "node_modules/use-http/dist/index.js".
⚠️  Could not load source file "../src/useMutation.ts" in source map of "node_modules/use-http/dist/useMutation.js".
⚠️  Could not load source file "../src/useFetch.ts" in source map of "node_modules/use-http/dist/useFetch.js".
⚠️  Could not load source file "../src/useQuery.ts" in source map of "node_modules/use-http/dist/useQuery.js".
⚠️  Could not load source file "../src/Provider.tsx" in source map of "node_modules/use-http/dist/Provider.js".
⚠️  Could not load source file "../src/FetchContext.ts" in source map of "node_modules/use-http/dist/FetchContext.js".
⚠️  Could not load source file "../src/types.ts" in source map of "node_modules/use-http/dist/types.js".
⚠️  Could not load source file "../src/utils.ts" in source map of "node_modules/use-http/dist/utils.js".
⚠️  Could not load source file "../src/doFetchArgs.ts" in source map of "node_modules/use-http/dist/doFetchArgs.js".
⚠️  Could not load source file "../src/useFetchArgs.ts" in source map of "node_modules/use-http/dist/useFetchArgs.js".
⚠️  Could not load source file "../useSSR.ts" in source map of "node_modules/use-ssr/dist/useSSR.js".
⚠️  Could not load source file "../src/index.ts" in source map of "node_modules/use-http/dist/index.js".
⚠️  Could not load source file "../src/useFetch.ts" in source map of "node_modules/use-http/dist/useFetch.js".
⚠️  Could not load source file "../src/useMutation.ts" in source map of "node_modules/use-http/dist/useMutation.js".
⚠️  Could not load source file "../src/useQuery.ts" in source map of "node_modules/use-http/dist/useQuery.js".
⚠️  Could not load source file "../src/Provider.tsx" in source map of "node_modules/use-http/dist/Provider.js".
⚠️  Could not load source file "../src/FetchContext.ts" in source map of "node_modules/use-http/dist/FetchContext.js".
⚠️  Could not load source file "../src/types.ts" in source map of "node_modules/use-http/dist/types.js".
⚠️  Could not load source file "../src/utils.ts" in source map of "node_modules/use-http/dist/utils.js".
⚠️  Could not load source file "../src/useFetchArgs.ts" in source map of "node_modules/use-http/dist/useFetchArgs.js".
⚠️  Could not load source file "../src/doFetchArgs.ts" in source map of "node_modules/use-http/dist/doFetchArgs.js".
⚠️  Could not load source file "../useSSR.ts" in source map of "node_modules/use-ssr/dist/useSSR.js".

Several Parcel.js issues (e.g. parcel-bundler/parcel#2356) suggest this is an issue of the published package.

@alex-cory
Copy link
Collaborator

Will take a look asap

@alex-cory
Copy link
Collaborator

alex-cory commented Mar 14, 2020

It would be nice if you can't get this working in a codesandbox, maybe make a repo reproducing the bug please 🙏❤️

@mdenburger
Copy link
Author

Sure, I've pushed a small demo project to https://github.com/mdenburger/use-http-202.

@alex-cory
Copy link
Collaborator

@mdenburger this should be fixed in v0.4.5

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

Successfully merging a pull request may close this issue.

2 participants