jadjoubran / webdash

🔥 Orchestrate your web project with Webdash the customizable web dashboard
https://webdash.xyz
MIT License
1.54k stars 70 forks source link

[bug 1.2.0] Some packages missing #48

Closed Neoares closed 6 years ago

Neoares commented 6 years ago

I recently upgraded (through webdash) to the version 1.2.0 of all the packages, and some of them disappeared. Concretely, webdash-npm-scripts and webdash-package-json. Also I don't find the react and react-dom ones, but I'm not sure if those 2 were present before the upgrade. In any case, they're missing.

In the package.json, the dependencies look correct.

"webdash": "^1.2.0",
"webdash-npm-scripts": "^1.2.0",
"webdash-package-json": "^1.2.0",
"webdash-performance-budget": "^1.2.0",
"webdash-pwa-manifest": "^1.2.0",
jadjoubran commented 6 years ago

Hi @Neoares thanks for opening the issue Are you using git? we can easily check what happened if you had a commit before upgrading if so, can you please run git diff and check what has changed?

jadjoubran commented 6 years ago

when you upgrade through webdash, you're simply running npm update {packagename} or yarn upgrade {packagename} (if you had a yarn.lock) so it should not remove packages but I'm happy to investigate or try to replicate it

Neoares commented 6 years ago

I'm using git, but haven't committed before upgrading, since I'm in a test branch. So my only diffs are the package.json, the package-lock.json, and webdash.json (as untracked file).

jadjoubran commented 6 years ago

okay and can you show me a screenshot of git diff package.json? mainly those with regards to webdash and react

Neoares commented 6 years ago

The diff in the package.json is what I posted in the thread:

+    "webdash": "^1.2.0",
+    "webdash-npm-scripts": "^1.2.0",
+    "webdash-package-json": "^1.2.0",
+    "webdash-performance-budget": "^1.2.0",
+    "webdash-pwa-manifest": "^1.2.0",

Since I saw the 2 packages from webdash disappearing from the app, I manually checked all my packages 1 by 1, and noticed about the react ones, but I'm not sure if they were missing before the upgrade (as opposite to the webdash ones, that I 100% know they were listed in the app before the upgrade).

jadjoubran commented 6 years ago

I saw the 2 packages from webdash disappearing from the app

so they were gone from package.json? if so, how come they show up here in the diff?

Neoares commented 6 years ago

Wait, we're talking about different things. My fault, I should've attached an image at first.

The package is still in package.json. The package is still installed correctly (I see the webdash-npm-scripts and the webdash-package-json "widgets" in the webdash app). What I'm not seeing is the packages I've mentioned in the webdash package.json list.

image

And as I said, the react and react-dom packages are also missing BUT from the list in the webdash app. There's nothing wrong with the packages itself.

jadjoubran commented 6 years ago

ohh okay hahah okay thanks for clarifying

can you please help me debug by following the below steps:

  1. restart webdash server, is it still an issue?
  2. can you try on another browser and check if the issue still persists?
  3. open dev tools and please show me the JSON object that you get back from /webdash-package-json/package-json
Neoares commented 6 years ago
  1. Yes.
  2. Yes.
  3. This is interesting. The response from http://localhost:3456/api/package-json/package-json are all my packages except the 2 I'm not seeing in the webdash app BUT I'm actually getting the 2 packages from react that are not showing up. But there's a strange behavior in those 2 packages.

image

As you can see, the data inside every package from the API response are "version", "from", and "resolved". But in the react and react-dom ones, I'm getting "required" and "peerMissing" set to true.

So I see 2 issues here. 2 packages not being returned from API, and 2 packages being returned but not being shown in the dashboard.

Neoares commented 6 years ago

Some update: I'm getting this at the very end of the npm list output:

npm ERR! peer dep missing: react@^0.14.0 || ^15.0.1, required by react-slick@0.15.0
npm ERR! peer dep missing: react-dom@^0.14.0 || ^15.0.1, required by react-slick@0.15.0

I guess it has something to do with that.

jadjoubran commented 6 years ago

yeah.. so this makes me feel that react is not installed.. is it? you can check by running this for example ls node_modulles/react or ls node_modules and checking for a react folder

jadjoubran commented 6 years ago

actually the problem is that you don't have react in your package.json but you have react-slick and react is a peer dependency of react-slick so the only solution would be to npm install react (not sure which version) and save it as a dependency

or alternatively, if you don't plan on using react-slick you can simply uninstall it with a --save (or --save-dev)

Let me know if that works for you

Neoares commented 6 years ago

They are installed, at version 16.0. The problem above is that react-slick asks for react 14 or 15, but not 16. So maybe my react-slick is not working properly, but react definitely does.

jadjoubran commented 6 years ago

ah makes sense okay, so it seems when you satisfy this peer dependency it should work but let's keep this open until we make sure it's fixed

Neoares commented 6 years ago

Update: it may be a bug in my npm or something, because npm list | grep react gives me this:

├─┬ babel-preset-react@6.24.1
│ ├─┬ babel-plugin-transform-react-display-name@6.25.0
│ ├─┬ babel-plugin-transform-react-jsx@6.24.1
│ │ ├─┬ babel-helper-builder-react-jsx@6.24.1
│ ├─┬ babel-plugin-transform-react-jsx-self@6.22.0
│ ├─┬ babel-plugin-transform-react-jsx-source@6.22.0
├─┬ UNMET PEER DEPENDENCY react@16.0.0
├─┬ react-bootstrap@0.30.10
│ ├─┬ react-overlays@0.6.12
│ │ ├── react-prop-types@0.4.0 deduped
│ ├─┬ react-prop-types@0.4.0
├─┬ UNMET PEER DEPENDENCY react-dom@16.0.0
├─┬ react-redux@5.0.5
│ ├─┬ create-react-class@15.6.0
│ ├── hoist-non-react-statics@1.2.0
├─┬ react-slick@0.15.0
│ ├── create-react-class@15.6.0 deduped
├─┬ react-toastify@3.3.3
│ └─┬ react-transition-group@2.2.1
npm ERR! peer dep missing: react@^0.14.0 || ^15.0.1, required by react-slick@0.15.0
npm ERR! peer dep missing: react-dom@^0.14.0 || ^15.0.1, required by react-slick@0.15.0

But as I said, react and react-dom packages are working perfectly. I'll have to take a look because I don't know what's happening. If your app is relying on npm list then is definitely not a bug in your code :)

jadjoubran commented 6 years ago

yes indeed, I simply run npm list --depth=0 --json --silent source

I'm going to close this issue but feel free to update it with your findings Thanks 😄