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

Source maps refer to invalid dependency paths #3058

Closed
justingrant opened this issue Apr 9, 2019 · 1 comment · Fixed by #3059
Closed

Source maps refer to invalid dependency paths #3058

justingrant opened this issue Apr 9, 2019 · 1 comment · Fixed by #3059
Labels
bug Something isn't working Build Related to build issues

Comments

@justingrant
Copy link
Contributor

justingrant commented Apr 9, 2019

Describe the bug
Sourcemaps for Amplify packages refer to invalid paths that existed at build time but don't exist when packages are installed from npm. This in turn breaks debugging in VSCode and other IDEs.

To Reproduce
Steps to reproduce the behavior:

  1. npm i aws-amplify
  2. open ./node_modules/aws-amplify/dist/aws-amplify.js.map
  3. Excerpt the first few lines, adding line-breaks and indenting for clarity.

Expected behavior
According to https://github.com/Microsoft/vscode-chrome-debug#sourcemaps, for VSCode to resolve these paths, they should either be relative to the current folder or should be absolute project-relative paths (starting with webpack:///./node_modules/). Like this:

{
  "version":3,
  "sources":[
    "webpack:///webpack/universalModuleDefinition",
    "webpack:///aws-amplify.js",
    "webpack:///webpack/bootstrap 8a9f9b8798564350c1fc",
    "webpack:///./node_modules/aws-sdk/lib/core.js",
    "webpack:///./node_modules/@aws-amplify/core/lib/index.js",
    "webpack:///./node_modules/graphql/module/error/index.js",
    "webpack:///./node_modules/graphql/module/type/definition.js",
    "webpack:///./node_modules/graphql/module/language/kinds.js",
    "webpack:///./node_modules/aws-sdk/lib/util.js",
    "webpack:///./node_modules/@aws-amplify/core/lib/Logger/index.js",

Actual behavior
Paths cannot be resolved by VSCode debugger because they don't exist after install from npm.

{
  "version":3,
  "sources":[
    "webpack:///webpack/universalModuleDefinition",
    "webpack:///aws-amplify.js",
    "webpack:///webpack/bootstrap 8a9f9b8798564350c1fc",
    "webpack:////root/app/node_modules/aws-sdk/lib/core.js",
    "webpack:///../core/lib/index.js",
    "webpack:////root/app/node_modules/graphql/module/error/index.js",
    "webpack:////root/app/node_modules/graphql/module/type/definition.js",
    "webpack:////root/app/node_modules/graphql/module/language/kinds.js",
    "webpack:////root/app/node_modules/aws-sdk/lib/util.js",
    "webpack:///../core/lib/Logger/index.js",

I'm working on a PR to fix this.

@alebiavati alebiavati added bug Something isn't working Build Related to build issues labels Apr 11, 2019
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Build Related to build issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants