Closed c0rydoras closed 7 months ago
Any chance you have a reproduction repo that demonstrates this problem?
@NullVoxPopuli I happen to have one :)
You can check out this ember-simple-auth
branch https://github.com/mainmatter/ember-simple-auth/pull/2604
I'm currently migrating the addon to V2 and also wanted to add tests for embroider specifically, but it fails for both embroider scenarios I've created.
Running ESA is pretty straightforward:
clone
the repopnpm install
pnpm install && pnpm run --filter test-app test:one embroider-lts-4.12
or pnpm install && pnpm run --filter test-app test:one embroider-ember-5
Bear in mind that the embroider-lts-4.12
scenario defines an environment variable ESA_TEST_EMBROIDER
that enables Embroider in the ember-cli-build.js
.
It does seem to at least throw an error on CI https://github.com/mainmatter/ember-simple-auth/actions/runs/5562444913/jobs/10160768826?pr=2604
I seem to have fixed this. Now it just throws and doesn't hang.
Turns out that pnpm
was using an incorrect node version 20.*
, pinning to 18.16.1
fixed the hangup.
@NullVoxPopuli to reproduce the problem simply create a new ember app with ember-cli
and the --embroider
flag, then try starting it with yarn start
and it will hang at the building... [@embroider/webpack]
forever
@C0rydoras is it possible that you have installed nodejs
and pnpm
with a package manager like pacman
or yay
?
If so pnpm could end up using a wrong version of nodejs.
In this case I'd recommend uninstalling pnpm and nodejs i.e. yay -R nodejs pnpm
and install pnpm with an installation script instead https://pnpm.io/installation
Please see if there's any warning in your console at the very start.
@BobrImperator yes, but the problem does not only occur when using pnpm
but also when using yarn
or npm
,
also yes when using nodejs
(newest version of node) I get this warning
WARNING: Ember CLI v4.12.1 is not tested against Node v20.4.0. See "https://github.com/ember-cli/ember-cli/blob/master/docs/node-support.md" to find out which version of Node is best to use.
I do normally use nodejs-lts-hydrogen
(v18 lts)
to reproduce the problem simply
I ran
❯ npx ember-cli@latest new test-embroider --embroider --yarn
My environment info:
❯ ember -v
ember-cli: 5.1.0
node: 18.16.0
os: linux x64
❯ which node
/home/nullvoxpopuli/.volta/bin/node
❯ which yarn
/home/nullvoxpopuli/.volta/bin/yarn
❯ yarn --version
1.22.19
❯ node --version
v18.16.0
❯ pnpm --version
8.6.5
However, when I switch to Node 20, I experience the same hangup you reported. :tada:
@NullVoxPopuli what linux distro?
❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
❯ uname -a
Linux hephaestus 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Installing the package managers & node with volta fixed the problem :D thank you
it we actually have a problem on node 20 we should keep this issue open
so been looking into this a bit and discovered something I really wasn't expecting
setting JOBS=0
env var makes the build work on nodejs >= 20
added bonus is it's it takes the same time to compile (or less - your results may vary :) )
How I reproduced in a separate embroider app:
pnpm i
pnpm build
cd docs-app
volta pin node@20
pnpm start
(stuck on building)JOBS=0 pnpm start
build completesSystem info (native ubuntu)
❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.04
Release: 23.04
Codename: lunar
❯ uname -a
Linux GhostLinux 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Confirmed that the above reproduction does not happen on Mac.
reproduced with Ubuntu 22 running in WSL on windows 10
reproduced with Debian 11:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
$ node --version
v20.5.1
(not using 'volta' but 'n' for node versions)
I think the issue is caused by https://github.com/webpack-contrib/thread-loader/issues/191. Setting the environment variable UV_USE_IO_URING=0 fixes my builds
@void-mAlex @NullVoxPopuli can we confirm that @jakesjews's suggestion fixes ember-primitives
too? I'm just trying to make sure that we are confident that this is the same issue 👍
Confirm, UV_USE_IO_URING=0 pnpm start
resolves the issue for ember-primitives
(after being configured for node 20)
my next question is what is that variable and what does it do
Node 20.3.0 updated libuv which added support for using linux io_uring in the filesystem instead of the thread pool. Setting UV_USE_IO_URING=0 disables io_uring. I'm not sure if its a bug with the io_uring stuff or if the performance improvement exposed some sort of race condition in a library somewhere
issue has now been reported on node 18.18 (and NOT happening on 18.17) -some of these are versions that GH actions run on
I've confirmed this is resolved in node 20.8.0
It looks like Node 18.18.1 is working through release now too: https://github.com/nodejs/node/pull/50066
We can close this when 18.18.1 is released and we confirm that it's fixing this.
closing as 18.18.1 is out with a fix for the issue and is available in github ci as well
Problem
I can't serve or build any embroider projects anymore (embroider versions tested 2.x, 3.x), its stuck at
⠋ building... [@embroider/webpack]
. I also tried different package managers (npm, pnpm, yarn) all resulting in the same state of⠋ building... [@embroider/webpack]
forever. This started after a system upgrade, since then i have tried these things:System details
OS:
archlinux
NPM:9.8.0
yarn:1.22.19
pnpm:8.6.7
node:16, 18 and 20
ember-source:4.12 and 5
ember-cli:4.12 and 5
ember-data:4.11, 4.12 and 5