Open marcnewton opened 5 years ago
Well, vue-cli 3 projects are always generated with a name, it's kind of required. We could enhance the error though.
Yes but, if you build your project by any other means or on top of say Laravel and forget to put the name because it is omitted in a laravel package file or say your a newbie and take it out by mistake, the vue cli becomes badly bricked.
The import tool needs to check what it is importing has a name set or it breaks it all but i feel something should be done to make sure the UI is not crippled by it.
Vue Project Manager wont list anything. TypeError: Cannot read property 'favorite' of null
Importing an unnamed project has caused this issue #2198 as I am now seeing this error:
An error occured vue-apollo.js:55 GraphQL error: Cannot return null for non-nullable field Project.name.
I checked in .vue-cli-ui/db.json and I can see:
{
"id": "8XUD7L3Iu",
"path": "D:\\var\\www\\vhosts\\laravue-spa-sessions",
"favorite": 0,
"type": "vue",
"openDate": 1545579060106
},
As you can see the name is missing, the only way to get out of this catastrophic simple mistake is to know to wipe the database or know how to fix the entry..
This issue seems to permanently break vue cli ui.
Project lists breaks, Dashboard and Analyzer all get totally wreaked, Plugins and Dependencies don't fully render, you cant even switch to another project.
Fixing the bad entries in the database restores all functionality.
The project import feature could sure get some love. I was thinking of auto-installing deps if node_modules
is missing and we could add this to the list. 😸
Version
3.2.1
Environment info
Steps to reproduce
Import a project containing a package.json with no "name" property.
What is expected?
Should default to string Undefined or Unnamed.
What is actually happening?
vue ui client blank screen behavior. ApolloError.js:37 Uncaught (in promise) Error: GraphQL error: Cannot return null for non-nullable field Project.name.
Adding missing "name" to package.json and forcing reload does not fix issue.