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 don't work for ncc run #263

Closed
rauchg opened this issue Feb 1, 2019 · 3 comments
Closed

Source maps don't work for ncc run #263

rauchg opened this issue Feb 1, 2019 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rauchg
Copy link
Member

rauchg commented Feb 1, 2019

/private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/webpack:/test.js:4
throw new Error('test');
^
Error: test
    at Object.294 (/private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/webpack:/test.js:4:1)
    at __webpack_require__ (/private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/webpack:/webpack/bootstrap:19:1)
    at startup (/private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/webpack:/webpack/bootstrap:33:1)
    at /private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/webpack:/webpack/bootstrap:37:1
    at Object.<anonymous> (/private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/index.js:43:10)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
@rauchg rauchg added the bug Something isn't working label Feb 1, 2019
@rauchg rauchg added the 1.0 label Feb 1, 2019
@rauchg
Copy link
Member Author

rauchg commented Feb 1, 2019

They also don't seem to get loaded when using ncc build -s

@guybedford
Copy link
Contributor

Believe it or not, what you are looking at is a completely working source map.

If you scroll all the way right, you can see webpack:/test.js:4:1 which represents the original source location.

When running ncc build -s the source map is outputted, but it will not actually run because Node.js does not support source maps. The only way to get them to "run" is via node -r source-map-support/register.js dist/index.js.

The three action items are:

  1. There is an issue to automatically inline the behaviour of the source map in Automatically include source-map-support library into build #180.
  2. When running ncc build x.js -s the source map file isn't coming up in the list of assets, even though it is there. This is an asset logging bug, will post a fix now.
  3. It should be possible in Webpack to somehow remove the /private/var/folders/bm/grflgmxs62g01cd9m8sjjm740000gn/T/d41d8cd98f00b204e9800998ecf8427e/webpack: prefix in the source map.

@sokra any clues on how we could tackle (3) here to make the source map filename look less cluttered?

@guybedford
Copy link
Contributor

This should be resolved now by #269 and #267.

Will aim to tackle #180 as well.

@styfle styfle added this to the 1.0.0 milestone Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants