nx-forge
nx-forge copied to clipboard
Serve (tunnel) executor throws a TypeError on forge project that doesn't have any custom UI
I have found that the nx serve forge-app
doesn't seem to work on forge apps that don't have a custom UI attached to it.
I ran the below command to generate an ESBuild forge app:
npx nx g @toolsplus/nx-forge:app my-forge-app --directory=my-forge-app --bundler=esbuild --projectNameAndRootFormat=as-provided
After doing the whole package & register setup, I try to run npx nx serve my-forge-app
and it fails with the below errors logs:
Wait for all Custom UI 'serve' targets to have started and servers are listening...
All Custom UI 'serve' targets have started and servers are listening
Running: forge tunnel --verbose
Failed to tunnel Forge app: TypeError: Cannot read properties of undefined (reading 'next')
NX Cannot read properties of undefined (reading 'next')
This is on node v20.x and Forge CLI version 10.5.0.
I have tried the same npx nx serve
command with an ESBuild forge app that has a custom UI attached to it using the resourceOutputPathMap
project.json package property and it works just fine.
:WORKAROUND: I have had some success of doing the below workaround:
-
npx nx package my-forge-app
-
npx nx build my-forge-app --watch
- cd into the dist of
my-forge-app
and runnpx forge tunnel
.