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

TypeError: Path must be a string #61

Closed
kublaios opened this issue Nov 10, 2018 · 4 comments
Closed

TypeError: Path must be a string #61

kublaios opened this issue Nov 10, 2018 · 4 comments
Assignees

Comments

@kublaios
Copy link

After installing the plugin, I restarted ST a couple of times after getting No imports found for 'FormControl' and then realised that I'm currently not in a project, so I created a project and restarted ST. Ever since I get this error on launch (on alert box), also imports are still not working:

Import Helper:
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received [ './dist/css/*', './dist/fonts/*' ]
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at ~/Library/Application Support/Sublime Text 3/Packages/ImportHelper/backend_run.js:5108:37
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

And here is the console output:

startup, version: 3176 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: ~/Library/Application Support/Sublime Text 3/Packages
state path: ~/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: ~/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["Vintage"]
Errors parsing theme:
icon_folder is missing layer0.opacity, setting to 1.0 for backwards compatibility
icon_folder_loading is missing layer0.opacity, setting to 1.0 for backwards compatibility
pre session restore time: 0.328992
startup time: 0.458999
environment variables loaded using: /bin/bash -l
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.01-pygments
reloading plugin 0_package_control_loader.50-markupsafe
reloading plugin 0_package_control_loader.50-pymdownx
reloading plugin 0_package_control_loader.50-python-markdown
reloading plugin 0_package_control_loader.50-pyyaml
reloading plugin 0_package_control_loader.51-python-jinja2
reloading plugin 0_package_control_loader.55-mdpopups
reloading plugin Angular CLI.Angular CLI
reloading plugin Emmet.emmet-plugin
reloading plugin GitGutter.plugin
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin Swift Autocomplete.subl
reloading plugin dired.common
reloading plugin dired.dired
reloading plugin dired.prompt
reloading plugin dired.show
reloading plugin ImportHelper.event_listener
reloading plugin ImportHelper.import_from_clipboard
reloading plugin ImportHelper.import_helper
reloading plugin ImportHelper.insert_import
reloading plugin ImportHelper.list_imports
reloading plugin ImportHelper.paste_import
reloading plugin ImportHelper.remove_unused
reloading plugin ImportHelper.utils
reloading plugin ImportHelper.view_event_listener
reloading plugin SFTP.SFTP
reloading plugin Terminal.Terminal
reloading plugin TypeScript.main
2018-11-10 21:54:23,193: 140735744836480: WARNING: TypeScript plugin initialized.
plugins loaded

lang_service_enabled: True
Path of tsserver.js: ~/Library/Application Support/Sublime Text 3/Packages/TypeScript/tsserver/tsserver.js
Path of tsc.js: ~/Library/Application Support/Sublime Text 3/Packages/TypeScript/tsserver/tsc.js
Trying to spawn node executable from: /usr/local/bin/node
ref view not found
Emmet: No need to update PyV8
Exec error: path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received [ './dist/css/*', './dist/fonts/*' ]
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at ~/Library/Application Support/Sublime Text 3/Packages/ImportHelper/backend_run.js:5108:37
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
error: Import Helper:
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received [ './dist/css/*', './dist/fonts/*' ]
    at assertPath (path.js:28:11)
    at Object.resolve (path.js:1171:7)
    at ~/Library/Application Support/Sublime Text 3/Packages/ImportHelper/backend_run.js:5108:37
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
Package Control: Skipping automatic upgrade, last run at 2018-11-10 21:52:05, next run at 2018-11-10 22:52:05 or after
@unlight
Copy link
Owner

unlight commented Dec 7, 2018

@kublaios
Sorry for delay, somehow I did miss notification.
Could you provide you package.json (dependency and dev dependency list)?

Error is coming from

// x or pkg.main equals to [ './dist/css/*', './dist/fonts/*' ]
loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {

This is from browser-resolve of browserify

I suspect that some of dependency using in package.main this value [ './dist/css/*', './dist/fonts/*' ], which is weird
https://github.com/stereobooster/package.json#main

As a workaround i can try to move it to optionalDependencies (if it is your 1st level dependency)

@unlight unlight self-assigned this Dec 7, 2018
@unlight unlight added the bug label Dec 7, 2018
@kublaios
Copy link
Author

kublaios commented Dec 8, 2018

Hey @unlight,

The project is the Angular 5 and Bootstrap 4 edition of a commercial template named MaterialWrap: http://materialwrap.authenticgoods.co

Here are the dependencies and devDependencies from package.json:

  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/cdk": "^5.2.4",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.4",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@asymmetrik/ngx-leaflet": "4",
    "@swimlane/ngx-charts": "^6.0.2",
    "@swimlane/ngx-datatable": "^11.2.0",
    "@types/leaflet": "1.2",
    "angular-gauge": "^3.1.0",
    "angular-webstorage-service": "^1.0.2",
    "angular2-moment": "^1.7.0",
    "angular2-text-mask": "^8.0.4",
    "bootstrap": "4.0.0",
    "chart.js": "^2.7.3",
    "chartist": "^0.11.0",
    "compass-mixins": "^0.12.10",
    "core-js": "^2.5.7",
    "countup.js-angular2": "1.1.1",
    "css-loader": "^0.28.7",
    "d3": "^4.10.2",
    "intl": "^1.2.5",
    "jquery": "^3.2.1",
    "leaflet": "1.3",
    "lodash": "^4.17.11",
    "markdown-it": "^8.4.2",
    "material-design-iconic-font": "^2.2.0",
    "material-design-icons": "^3.0.1",
    "mdi": "^2.0.46",
    "multi-brand-colors": "^1.1.3",
    "ng-chartist": "^1.1.1",
    "ng2-charts": "^1.6.0",
    "ng2-date-picker": "^2.10.2",
    "ng2-dnd": "^4.2.0",
    "ng2-float-btn": "0.0.3",
    "ng2-responsive": "^0.8.4",
    "ng2-search-filter": "^0.4.7",
    "ng2-validation": "^4.2.0",
    "ngx-bootstrap": "^2.0.2",
    "ngx-malihu-scrollbar": "^1.2.2",
    "ngx-perfect-scrollbar": "^5.3.5",
    "ngx-uploader": "^4.0.0",
    "node-sass": "^4.10.0",
    "rxjs": "^5.5.12",
    "sweetalert2": "^7.29.0",
    "text-mask-addons": "^3.8.0",
    "weather-icons": "^1.3.2",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.8",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/chartist": "^0.9.43",
    "@types/jasmine": "2.8.3",
    "@types/jquery": "^3.3.22",
    "@types/jquery-mousewheel": "^3.1.8",
    "@types/lodash": "^4.14.118",
    "@types/mcustomscrollbar": "^2.8.32",
    "@types/node": "~8.0.31",
    "codelyzer": "~3.2.0",
    "css-to-string-loader": "^0.1.3",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.3.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "loaders.css": "^0.1.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.3.0",
    "tslint": "~5.9.1",
    "typescript": "~2.6.2"
  }

@unlight
Copy link
Owner

unlight commented Dec 9, 2018

@unlight
Copy link
Owner

unlight commented Dec 21, 2018

Fixed in v2.0.5

@unlight unlight closed this as completed Dec 21, 2018
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

2 participants