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

Unable to open web browser. Invalid switch - "/tmp" #161

Open
imoark opened this issue Feb 13, 2020 · 3 comments
Open

Unable to open web browser. Invalid switch - "/tmp" #161

imoark opened this issue Feb 13, 2020 · 3 comments

Comments

@imoark
Copy link

imoark commented Feb 13, 2020

Description
I'm working on create-react-app@3.0.1 and I got this error.

$ source-map-explorer build/static/js/*.js
build/static/js/2.9d3308cf.chunk.js
  Unable to map 86/5098426 bytes (0.00%)
build/static/js/main.b235dfa8.chunk.js
  Unable to map 77/248845 bytes (0.03%)
build/static/js/runtime~main.a8a9905a.js
  Unable to map 13/1502 bytes (0.87%)
Unable to open web browser. Invalid switch - "/tmp".
Either run with --html, --json, --tsv, --file, or view HTML for the visualization at:
/tmp/sme-result-2020113-220-1f3lsmg.3b1gf.html

Steps to reproduce

  1. Build your create-react-app with npm run build
  2. run $ source-map-explorer build/static/js/*.js
  3. See error

Expected behavior
It should open the web browser and show the visualization.

Environment

  • OS: Microsoft Windows [Version 10.0.17763.805]
  • Terminal WSL 1
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
  • source-map-explorer Version [2.1.2]

Additional context
I can still see the /tmp/sme-result-2020113-220-1f3lsmg.3b1gf.html generated. I can still also put --html params and it will generate the file alright. I'm just wondering how to get the proper/expected behaviour if I am using WSL.

Couldn't test with source-map-explorer@2.2.2 because it's too slow.

I tried with source-map-explorer@2.0.1

$ source-map-explorer build/static/js/*.js
build/static/js/2.9d3308cf.chunk.js
  Unable to map 130/5098425 bytes (0.00%)
build/static/js/main.b235dfa8.chunk.js
  Unable to map 124/248844 bytes (0.05%)
build/static/js/runtime~main.a8a9905a.js
  1. Your source map only contains one source (../webpack/bootstrap).
  This can happen if you use browserify+uglifyjs, for example, and don't set the --in-source-map flag to uglify.
  See https://github.com/danvk/source-map-explorer/blob/master/README.md#generating-source-maps
  2. Unable to map 62/1501 bytes (4.13%)
Unable to open web browser. Invalid switch - "/tmp".
Either run with --html, --json, --tsv, --file, or view HTML for the visualization at:
/tmp/sme-result-2020113-146-119t6vf.v2pk.html
@nikolay-borzov
Copy link
Collaborator

sme uses open for opening files.

@imoark
Copy link
Author

imoark commented Feb 20, 2020

I see. I guess open doesn't support WSL 1 very well.

Then, my workaround for now:

  1. $ source-map-explorer build/static/js/*.js --html ./some-file-name.html and manually open the some-file-name.html
  2. Or use MINGW64 terminal on Windows

If anyone can have a better solution, kindly leave a comment below.

@stof
Copy link

stof commented Nov 1, 2020

According to their readme, it supports WSL paths under /mnt/* (i.e. files being on the windows filesystem). But here, the file is on the linux filesystem, and so is affected by sindresorhus/open#174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants