Skip to content

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

Closed
@mdenburger

Description

@mdenburger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions