Skip to content

Published sourcemaps contain absolute paths in publisher's home directory #13883

@jsnajdr

Description

@jsnajdr
  1. Install the @wordpress/api-fetch package into your project.
  2. Look at the node_modules/@wordpress/api-fetch/build/index.js.map file.

The sources field near the beginning contains an absolute path into Riads home directory:

/Users/riad/Workspace/a8c/gutenberg/packages/api-fetch/src/index.js

I discovered this when upgrading Calypso to Jest 24.1 in Automattic/wp-calypso#30434. Jest uses sourcemaps to show error stack traces, which are therefore confusing:

    ReferenceError: regeneratorRuntime is not defined

      at ../../../riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/fetch-all-middleware.js:42:25
      at Object.<anonymous> (../../../riad/Workspace/a8c/gutenberg/packages/api-fetch/src/middlewares/fetch-all-middleware.js:42:25)
      at Object.<anonymous> (../../../riad/Workspace/a8c/gutenberg/packages/api-fetch/src/index.js:12:1)
      at Object.<anonymous> (client/gutenberg/editor/api-middleware/index.js:9:1)
      at Object.<anonymous> (client/gutenberg/editor/api-middleware/test/index.js:9:1)

(don't pay much attention to the regeneratorRuntime error, it's not related to this bug)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Technical FeedbackNeeds testing from a developer perspective.[Type] BugAn existing feature does not function as intended[Type] Build ToolingIssues or PRs related to build toolingnpm PackagesRelated to npm packages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions