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

Python error: Can't convert 'NoneType' object to str implicitly #10

Open
alebiavati opened this issue Jun 18, 2016 · 0 comments
Open

Python error: Can't convert 'NoneType' object to str implicitly #10

alebiavati opened this issue Jun 18, 2016 · 0 comments

Comments

@alebiavati
Copy link
Contributor

Hi! Thank you for writing this plugin, looks like it could really speed up development! I'm trying the plugin for the first time and I'm getting this error:

['/Users/alebiavati/.nvm/versions/node/v5.9.0/bin/importjs', None, '/Users/alebiavati/code/test-project/src/test.js']
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 568, in run_
    return self.run(edit, **args)
  File "import-js in /Users/alebiavati/Library/Application Support/Sublime Text 3/Installed Packages/ImportJS.sublime-package", line 114, in run
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1386, in _execute_child
TypeError: Can't convert 'NoneType' object to str implicitly

My configuration is this:

/Users/alebiavati/code/test-project/.importjs.json

{
  "lookupPaths": ["src"],
  "useRelativePaths": true,
  "importDevDependencies": true,
  "aliases": {
    "$": "third-party-libs/jquery",
    "styles": "./{filename}.scss"
  }
}

and my test file is this:

/Users/alebiavati/code/test-project/src/test.js

import MainNav from './components/MainNav';

const test = MainNav;

/Users/alebiavati/code/test-project/src/components/MainNav.js

import { Component } from 'react';

export default class MainNav extends Component { }

If I run importjs from the command line I get the proper result:

$ importjs goto MainNav src/test.js
{"messages":[],"fileContent":"import MainNav from './components/MainNav';\n\nconst test = MainNav;\n","unresolvedImports":{},"goto":"src/components/MainNav.js"}

but when using the sublime plugin I get the error above. This happens if I try to use any of the importjs commands: goto module, import word under cursor, or fix all imports.

Have you ever seen something like this?

Thanks in advance for the help! and again, great plugin!!

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

1 participant