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

fix(js-cli): Provide a helpful error message if devPath is not specified #129

Closed
wants to merge 1 commit into from

Conversation

rajivshah3
Copy link
Member

@rajivshah3 rajivshah3 commented Dec 2, 2019

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • New Binding Issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes. Issue #___
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch and not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:
Currently, running tauri dev when a devPath is not specified in tauri.conf.js returns the following error:

(node:10828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of undefined
    at Runner.run (/Users/rajiv/.config/yarn/global/node_modules/tauri/runner.js:45:37)
    at Object.<anonymous> (/Users/rajiv/.config/yarn/global/node_modules/tauri/bin/tauri-dev.js:34:7)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at tauri (/Users/rajiv/.config/yarn/global/node_modules/tauri/bin/tauri.js:33:5)
    at Object.<anonymous> (/Users/rajiv/.config/yarn/global/node_modules/tauri/bin/tauri.js:40:1)

Providing a message such as Error: devPath not specified, please check your tauri.conf.js will help users figure out what's wrong without having to look through the source code of the CLI to find what Cannot read property 'startsWith' of undefined means.

@rajivshah3 rajivshah3 changed the title fix(js-cli): Provide a helpful error message if devPath is not defined fix(js-cli): Provide a helpful error message if devPath is not specified Dec 2, 2019
@nothingismagick
Copy link
Sponsor Member

Thanks @rajivshah3 - but I spoke briefly with Lucas right now - and we think it would be better to do the validation in tauri-config.js- because that separates the concerns better. But otherwise your intuition is spot on.

@rajivshah3
Copy link
Member Author

rajivshah3 commented Dec 3, 2019

we think it would be better to do the validation in tauri-config.js

Yeah, that makes more sense. This was more of a hotfix for something I ran into a couple hours ago but I also agree that the validation should be done outside the runner

@rajivshah3 rajivshah3 deleted the fix/devPath-undefined branch December 3, 2019 03:26
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

Successfully merging this pull request may close these issues.

None yet

2 participants