You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project that is utilizing the @nx-go/nx-go extension that's used for supporting Go applications.
When I attempt to use the @nx/workspace:move generator to move a Go library, it'll produce an error. (Please refer to the Failure Logs section for said error.)
Sadly, there isn't a consistent means to get the bun to start showing up, but once it does, the issue will persist throughout the workspace's life cycle.
I was able to trace this to the compiled Javascript files within Nx's installed project files under the node_modules directory, which is where I found a workaround. That being to have the secondaryEntryPointImportPaths variable (located within the updateImports function) set with an empty array on the same line it's declared.
However, this will produce a tsconfig.base.json file at the root of the workspace with the text undefined contained within it and with no actual JSON to speak of.
Expected Behavior
I have a project that is utilizing the @nx-go/nx-go extension that's used for supporting Go applications.
The @nx/workspace:move schematic generator should be able to move libraries based in Go and other programming languages without any errors popping up.
It should also do it without generating an empty tsconfig.base.json file if one didn't exist previously. This tends to be the case when there is no Typescript to speak of within the Nx workspace. For example, an Nx workspace initiated with the @nx-go/nx-go preset.
As stated in the Current Behavior section, it isn't consistent to get this bug to start showing up; however, once it does start popping up, the bug will persist throughout the workspace's lifespan.
Also, keep in mind that these commands will require the installation of Bun,, as that is what I used for my project that's referenced under GitHub Repo.
The best way I can think to recreate it would be with the following:
Use the following command to create a workspace: bun x create-nx-workspace lazynx --preset=@nx-go/nx-go
Use the following command to create a library:bun run nx g @nx-go/nx-go:library --name=foobar --directory=libs/foobar --projectNameAndRootFormat=as-provided
Repeatedly move and/or remove library or libraries repeatedly until the error appears.
Nx Report
Node : 22.9.0
OS : linux-x64
Native Target : x86_64-linux
bun : 1.1.25
NX Cannot read properties of undefined (reading 'map')
TypeError: Cannot read properties of undefined (reading 'map')
at updateImports (/Projects/lazynx/node_modules/@nx/workspace/src/generators/move/lib/update-imports.js:47:43)
at moveGeneratorInternal (/Projects/lazynx/node_modules/@nx/workspace/src/generators/move/move.js:42:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Projects/lazynx/node_modules/nx/src/command-line/generate/generate.js:241:26
at async handleErrors (/Projects/lazynx/node_modules/nx/src/utils/params.js:22:24)
at async Object.handler (~/Projects/lazynx/node_modules/nx/src/command-line/generate/command-object.js:13:22)
error: script "nx" exited with code 1
Package Manager Version
1.1.25
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
I have a project that is utilizing the
@nx-go/nx-go
extension that's used for supporting Go applications.When I attempt to use the
@nx/workspace:move
generator to move a Go library, it'll produce an error. (Please refer to the Failure Logs section for said error.)Sadly, there isn't a consistent means to get the bun to start showing up, but once it does, the issue will persist throughout the workspace's life cycle.
I was able to trace this to the compiled Javascript files within Nx's installed project files under the
node_modules
directory, which is where I found a workaround. That being to have thesecondaryEntryPointImportPaths
variable (located within theupdateImports
function) set with an empty array on the same line it's declared.However, this will produce a
tsconfig.base.json
file at the root of the workspace with the textundefined
contained within it and with no actual JSON to speak of.Expected Behavior
I have a project that is utilizing the
@nx-go/nx-go
extension that's used for supporting Go applications.The
@nx/workspace:move
schematic generator should be able to move libraries based in Go and other programming languages without any errors popping up.It should also do it without generating an empty
tsconfig.base.json
file if one didn't exist previously. This tends to be the case when there is no Typescript to speak of within the Nx workspace. For example, an Nx workspace initiated with the@nx-go/nx-go
preset.GitHub Repo
https://github.com/KerickHowlett/lazynx
Steps to Reproduce
As stated in the Current Behavior section, it isn't consistent to get this bug to start showing up; however, once it does start popping up, the bug will persist throughout the workspace's lifespan.
Also, keep in mind that these commands will require the installation of Bun,, as that is what I used for my project that's referenced under GitHub Repo.
The best way I can think to recreate it would be with the following:
bun x create-nx-workspace lazynx --preset=@nx-go/nx-go
bun run nx g @nx-go/nx-go:library --name=foobar --directory=libs/foobar --projectNameAndRootFormat=as-provided
Nx Report
Node : 22.9.0
OS : linux-x64
Native Target : x86_64-linux
bun : 1.1.25
nx : 19.6.2
@nx/workspace : 19.6.2
@nx/devkit : 19.6.2
@nrwl/tao : 19.6.2
typescript : 5.5.4
Registered Plugins:
@nx-go/nx-go
Community plugins:
@nx-go/nx-go : 3.2.0
Failure Logs
NX Cannot read properties of undefined (reading 'map')
TypeError: Cannot read properties of undefined (reading 'map')
at updateImports (
/Projects/lazynx/node_modules/@nx/workspace/src/generators/move/lib/update-imports.js:47:43)/Projects/lazynx/node_modules/@nx/workspace/src/generators/move/move.js:42:40)at moveGeneratorInternal (
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async
/Projects/lazynx/node_modules/nx/src/command-line/generate/generate.js:241:26/Projects/lazynx/node_modules/nx/src/utils/params.js:22:24)at async handleErrors (
at async Object.handler (~/Projects/lazynx/node_modules/nx/src/command-line/generate/command-object.js:13:22)
error: script "nx" exited with code 1
Package Manager Version
1.1.25
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: