Questions tagged [nxjs]

Primarily used for javascript/typescript libraries.

See https://nx.dev/

13 questions
6
votes
2 answers

NX Error for Relative Imports within the Same Project

I'm getting an error when using TS aliased paths within the same project: Projects should use relative imports to import from other files within the same project I don't want this behavior. Any idea how to disable? I tried playing with the…
S. C.
  • 127
  • 1
  • 6
2
votes
0 answers

Webpack Bundle Not Executing

I created a bundle using webpack (Nx's Webpack executor to be more exact) and it is bundling the code in a way that requires it to be explicitly called by some other script, rather than self-executing. However, when I bundle the same exact code…
S. C.
  • 127
  • 1
  • 6
2
votes
2 answers

Publishable CSS library in NX monorepo

We need to create a pure CSS library that can be used by our Angular, React, Vue and WC applications and libraries. Something that can be accessed in a way like @myorg/styles. It seems related to this ticket #54 but it's already Closed with a…
raberana
  • 11,739
  • 18
  • 69
  • 95
2
votes
1 answer

NX Can't import local Typescript library

I'm trying to follow the "NX and Typescript" doc. I have run the following (with Node 16.16.6 and NX 14.5.8): npx create-nx-workspace happynrwl --preset=ts cd happynrwl npm install @nrwl/web nx generate @nrwl/js:library --name=hello-tsc…
SimpleJ
  • 13,812
  • 13
  • 53
  • 93
2
votes
1 answer

How to add base/baseHref to Nx/Vite manifest.json file

How can I prefix the file, css, and assets in a Vite manifest.json file with a CDN URL? export default defineConfig({ base: 'https://my-cdn.com/', build: { manifest: true, rollupOptions: { input: '/path/to/main.js' } …
widan35174
  • 21
  • 1
1
vote
2 answers

set package version as env var in Nx

I am trying to access from browser the package.json version In Nx, it is possible to hardcode env vars in a .env file and have them passed to process.env.{varname} if the variables are prefixed vith NX_. I can't hardcode the variable though, I need…
undefinederror
  • 821
  • 1
  • 8
  • 16
0
votes
0 answers

How to generate NX monorepo with different Angular version

I started exploring the possibility of switching to monrepo using NX. I ran into a problem when I generate a new project according to the instructions from the site, the latest version of Angular is used (>16.0.0). Is there a possibility to choose…
Rouvas
  • 1
0
votes
1 answer

NX NextJs App doesn't work on read-only docker container

I have a Dockerfile that builds an nx app and then serves it, however that docker container runs in read-only mode and that causes this problem: EROFS: read-only file system, open '/app/node_modules/.cache/nx/project-graph.json~c3501751' Error:…
Adolfo
  • 798
  • 1
  • 7
  • 15
0
votes
0 answers

Next 13 mounting under a subpath on the server

I'm setting up a NextJS 13 app under a subpath (/my-app) on my host. But it seems that it only works partially, it also feels that I'm fixing one thing and then another thing pops up. I tried the following things: I tried setting the base path in…
Vince V.
  • 3,115
  • 3
  • 30
  • 45
0
votes
0 answers

How to set up a custom server using nx and next.js combined

I'm looking to set up a http server like the server.js described in https://nextjs.org/docs/advanced-features/custom-server in my nx project, however, when I add an executor to run node server.js I'm getting an…
user2167582
  • 5,986
  • 13
  • 64
  • 121
0
votes
0 answers

Debug NX Executor

Currently, my setup: @nrwl/webpack + withReact and withNx plugins -- is exporting CSS files with hashes. For my specific project, we need to have files without hashes. We can strip the hashes after building, but that's really just a workaround. I…
S. C.
  • 127
  • 1
  • 6
0
votes
1 answer

nx.js using capacitor Cannot find module 'nx/src/utils/app-root'

In my NX project, I have a capacitor Angular 14 application, when using cap:sync, I get the following error which stomps me. > nx run caregiver:sync:ios --verbose=true > NX Cannot find module 'nx/src/utils/app-root' Require stack: -…
0
votes
1 answer

Testing files to only include specific folder for nx run-many

In package.json there is the following task: { "test": "nx run-many --target=test --code-coverage --projects=myproject, anotherproject --parallel --maxParallel" } Now for just the Angular project 'myproject' I would like to run only in a specific…
Remi
  • 4,663
  • 11
  • 49
  • 84