Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with @nx/workspace for Polyglot Projects #28349

Open
1 of 4 tasks
KerickHowlett opened this issue Oct 7, 2024 · 0 comments
Open
1 of 4 tasks

Issues with @nx/workspace for Polyglot Projects #28349

KerickHowlett opened this issue Oct 7, 2024 · 0 comments
Assignees
Labels

Comments

@KerickHowlett
Copy link

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 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.

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:

  1. Use the following command to create a workspace: bun x create-nx-workspace lazynx --preset=@nx-go/nx-go
  2. 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
  3. 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 : 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)
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

KerickHowlett pushed a commit to KerickHowlett/nx that referenced this issue Oct 7, 2024
…he creation of any unneeded tsconfig files

closed nrwl#28349
KerickHowlett pushed a commit to KerickHowlett/nx that referenced this issue Oct 10, 2024
@jaysoo jaysoo self-assigned this Oct 14, 2024
@jaysoo jaysoo added the scope: misc Misc issues label Oct 14, 2024
KerickHowlett added a commit to KerickHowlett/nx that referenced this issue Nov 28, 2024
KerickHowlett pushed a commit to KerickHowlett/nx that referenced this issue Dec 17, 2024
KerickHowlett added a commit to KerickHowlett/nx that referenced this issue Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants