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

Wrong path to source files in sourcemap #1180

Closed
cnshenj opened this issue Apr 13, 2018 · 4 comments
Closed

Wrong path to source files in sourcemap #1180

cnshenj opened this issue Apr 13, 2018 · 4 comments

Comments

@cnshenj
Copy link

cnshenj commented Apr 13, 2018

🐛 bug report

🎛 Configuration (.babelrc, package.json, cli command)

Project structure:

project
+-- public
    +-- scripts
        +-- entry.js
        +-- module1.js
        +-- module2.js
    +-- dist

entry.js (dynamic import that enables code splitting)

import("./module1");

modules1.js

import "./module2";

Working directory: project
Command: parcel build public\scripts\entry.js --out-dir public\dist

🤔 Expected Behavior

The correct reference path to module2.js in public/dist/module1.xxxxxxxx.map should be ../scripts/module2.js

😯 Current Behavior

public/dist/module1.xxxxxxxx.map contains reference to module2.js like this: module2.js, which is wrong.

🌍 Your Environment

Software Version(s)
Parcel 1.7.0
Node 8.11.1
npm/Yarn 1.5.1
Operating System Windows 10 x64
@DeMoorJasper
Copy link
Member

This is correct behaviour parcel looks relative from the root which is the directory with the entrypoint.

In the next parcel version pointing to this folder using sourceRoot. This should fix this behaviour feel free to try out the master branch

Sent with GitHawk

@felixrabe
Copy link

In the next parcel version ...

Was just about to ask for the relevant change, but found it here: #1141

@duncansultan
Copy link

I'm still having an issue with this on version 1.9.7 which seems to include #1141.

"build": "parcel build _head.html --public-url ./dist/",

WebApp (Asp.net) /
├── _head.html
├── _head.js (import js files here)
├── dist/
│ ├── _head.html
│ ├── _head{randomsuffix}.css
│ ├── _head{randomsuffix}.js
│ └── _head{randomsuffix}.map
└── Views/
└── Shared/
└── _Layout.cshtml (reference ~/dist/_head.html)

In the JavaScript console.
DevTools failed to parse SourceMap: https://localhost:44309/dist/dist/_head.496e4826.map

@DeMoorJasper Should I create a new issue for this?

Is there a configuration/options file I need to create for setting the sourceRoot variable?

Thanks for your help.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Jul 31, 2018

@duncansultan Feel free to open a new issue, this is probably a windows bug. Feel free to look into and fix this bug as we barely have any windows contributors

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

No branches or pull requests

4 participants