Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Fish shell #65

Closed
ghostdevv opened this issue Apr 29, 2021 · 22 comments
Closed

Fish shell #65

ghostdevv opened this issue Apr 29, 2021 · 22 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@ghostdevv
Copy link

This doesn't seem to work for me using fish, I had to switch to bash. While this isn't a problem it would be nice to support it.

OS: Manjaro Linux
Fish: 3.2.1
Node: 12 (latest)
Node gui: Starter template

@shirakaba
Copy link
Collaborator

doesn't seem to work

In what way does it fail? Please provide details (e.g. CLI logs, error logs). Does it fail at build-time or run-time?

@ghostdevv
Copy link
Author

Both build time and run time, I can try and get an error log for you both later tonight

@shirakaba
Copy link
Collaborator

Yes please! Otherwise I've got nothing to go on.

@ghostdevv
Copy link
Author

Hey, sorry for the late response @shirakaba . Here is the output of npm run dev after following the instructions here: https://sourceb.in/Tf2EFw8sDW

This might be a problem with npm install in fish as it seems to take a shorter amount of time and prints a lot less in fish than bash, it might be that fish isn't running something or building it properly?

@ghostdevv
Copy link
Author

Update: this definitely seems like a problem with npm install as I switched to bash and typed npm install and it worked. Not sure if this problem is caused by npm or nodegui

@shirakaba
Copy link
Collaborator

@ghostdevv thanks for the details. It looks like bundling failed because the @nodegui/svelte-nodegui node module hadn’t been installed. So the question is why it hadn’t been installed.

What happens when you do a fresh clone of the starter template (in Fish) and follow the instructions up to and including the run npm install step? Is there an error seen during installation?

@ghostdevv
Copy link
Author

I think running npm install in fish is causing whatever the build process that should run to not run. When I run npm install in bash it's running fine

@shirakaba
Copy link
Collaborator

@ghostdevv I've just updated the starter template because the package-lock had a possible version mismatch with the package.json. If you could please try starting a project afresh from that, I'd be interested to know the outcome.

@shirakaba
Copy link
Collaborator

@ghostdevv Also, what version of Node are you using?

@ghostdevv
Copy link
Author

ghostdevv commented May 3, 2021

I was doing some more debugging and I noticed when fish started it is defaulting to node 16.0.0 for some reason, it's supposed to be on 14.x, when typing fish then node -v again it goes back to 14.x which works. Very odd.

Seems to just be issues with node 16 then.

Very odd:

@ghostdevv
Copy link
Author

This is odd, I managed to sort out the version issue using a port of nvm for fish and installing worked fine however I am still getting the error, here is a fresh copy in case it's different: https://sourceb.in/KYdP9NaeoV

The same error happens when running npm run dev in bash so it might still be a install issue?

Both bash and fish are showing the same node version so I tried to do a fresh install via bash and it did not work.

@shirakaba
Copy link
Collaborator

I'm (successfully) using Node v14.6.0 myself, so I think we're onto something. What npm version is referenced? I'm on npm v6.14.7.

The same error happens when running npm run dev in bash so it might still be a install issue?

The error in your paste indicates that both Webpack and ts-loader are failing to resolve @nodegui/svelte-nodegui, so it would seem that node_modules/@nodegui/svelte-nodegui is missing following your npm install. Is this the case? I wonder whether the require() algorithm changed in some way since Node v14. But seems unlikely... Is node_modules/@nodegui/svelte-nodegui genuinely missing in your project?

The key thing I do know that changed since npm v6 (which was contemporary with Node v14) is how peer dependencies are handled.

If you're using npm v7 or higher, you could try npm install --legacy-peer-deps instead of npm install to keep installation consistent. Or just install using npm v6.

Could you provide full logs of what happens following a fresh npm install in fish?

@ghostdevv
Copy link
Author

ghostdevv commented May 3, 2021

I am on npm 6.14.13, here are logs from npm install in fish: https://sourceb.in/oNS5t4nR1E

That dir exists:

@ghostdevv
Copy link
Author

I am not sure this is just fish, I just tried in only bash and it still can't find svelte-nodegui. Which is making me confused.

I tried just basic node gui and it worked fine so I think that rules out possible system requirement errors? (Works in both fish and bash)

@shirakaba
Copy link
Collaborator

I have a suspicion.

As far as I can see (I’m on my phone), the @nodegui/svelte-nodegui/package.json lacks a main field.

The Rollup bundle I believe is outputting to dist/index.js:

file: "dist/index.js",

Could you try manually patching that package.json to set the main field as such, then running npm run dev?

@shirakaba
Copy link
Collaborator

Okay after many red herrings, I've found the problem.

In (at least) the last release of Svelte NodeGUI, I clearly ran npm publish --access=public in the root directory instead of npm run deploy, so it published the repo root rather than the built repo. This is clear because the node module only contains sources and no built files.

I'll republish it this evening (or during my lunch break in the next couple of hours if I have time). I don't know which was the last working release of Svelte NodeGUI, unfortunately, but it's worth waiting for this one because the last few releases fixed some significant things.

@shirakaba shirakaba self-assigned this May 4, 2021
@shirakaba
Copy link
Collaborator

Until I have a moment to republish the package, your best option is to try downgrading through each different version of @nodegui/svelte-nodegui until you find one that works.

The last versions are:

0.1.1 (this is the latest one, and is known to be broken)
0.1.0
0.0.4
0.0.3-alpha.1
0.0.2-alpha.2
0.0.2-alpha.1

@shirakaba
Copy link
Collaborator

I've republished it; should be fixed in version 0.1.2:

npm install --save "@nodegui/[email protected]"

@ghostdevv
Copy link
Author

So I can actually get something running now, webpack seems to just hang in both build and dev, I exited after a few minutes of it having and tried npm run start and got this:

It is still not building the stuff it's supposed to in fish so had to run npm install with bash

@shirakaba shirakaba reopened this May 10, 2021
@shirakaba
Copy link
Collaborator

shirakaba commented May 10, 2021

So I can actually get something running now, webpack seems to just hang in both build and dev,

In dev mode, the Webpack process is set to "watch" mode, so it awaits changes to your files; is that what you're seeing? Does it react (i.e. live-reload) when you save a change to a .svelte file?

But as you say, if the build command hangs, then it's probably something else.

It is still not building the stuff it's supposed to in fish so had to run npm install with bash

As I neither use Manjaro Linux nor Fish shell, I don't have much to go on. That npm install isn't behaving correctly on Fish is out-of-scope for Svelte NodeGUI, I'm afraid – that sounds more like an issue regarding some combination of Node, npm, Fish, and Linux. If it's not much trouble, I'd recommend just continuing with bash for Svelte NodeGUI development if you possibly could!

The screenshot of the running app is disheartening. Although the elements are all there, it looks like Flexbox layout is not very happy at all. Unfortunately that's out of my expertise – it's the parent project, NodeGUI, that implemented the lower-level features like that. The fact that the app appears to be generally working otherwise makes me think this is primarily an issue of Linux support. But maybe it is something to do with the build going wrong in some way.

@ghostdevv
Copy link
Author

Hey sorry for the late reply. If it doesn't work in fish it doesn't, I could make a issue in NodeGUI but I would need to do some testing to see if it's my setup or other setups. As long as I can run it in bash that is no problem

@shirakaba shirakaba added the wontfix This will not be worked on label Dec 27, 2021
@shirakaba
Copy link
Collaborator

I won't be working on fish shell support, so I'm afraid I will be closing this issue; all I can recommend is to use bash or zsh.

The layout problem is another matter: discussion moving to #72.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants