Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Oleg Smirnov
    @osmirnov
    @DaveMBush Yes, it does. Usually, it was being solved by strict-ssl=false for respective package managers. I am looking for similar setting in Nx.
    Dave Bush
    @DaveMBush

    I had a similar issue getting cypress to install. The problem is, more than likely, a node issue, which doesn't obey npm settings.

    You will need to grab your company's additional certs and set the environment variable NODE_EXTRA_CA_CERTS to the path where those certs are stored on your computer in PEM format.

    I'm just guessing about the internals here because I don't use the NxCloud for security reasons

    Lean Junio
    @leanjunio
    Hey guys, is it possible for multiple libraries to share assets with each otheR?
    Oleg Smirnov
    @osmirnov
    Thanks @DaveMBush. I'll give it a shot.
    Oscar Pabon
    @oscarandrespabonestrella

    Hello all, i am facing an issue tryien to inject some javascript in the angular.json, that issue is just happening in nrwl

    "scripts": [
    "node_modules/prismjs/prism.js",
    "node_modules/prismjs/components/prism-typescript.min.js"
    ],

    I am trying to do that, but the console is throwing the next error : An unhandled exception occurred: The @node_modules/prismjs/themes/prism-okaidia.css asset path must start with the project source root.

    do you have an idea about how to solve this?

    thanks in advance

    Dave Bush
    @DaveMBush

    @oscarandrespabonestrella
    It doesn't understand the @node_modules thing.
    Try using "node_modules/prismjs/prism.js" for example.

    It works in my code.

    Akshay Kumar
    @akshay-nm
    Hey guys! I've setup an app (to be deployed as aws lambda) and a lib. The lib depends on mongoose. I've added mongoose in the root package.json in my nx-workspace. But the final build throws "cannot find module 'mongoose'". How do I go about fixing this?
    Do I have to specify something in workspace.json, or nx.json?
    narendrapolasamn
    @narendrapolasamn
    Hello Guys,
    NX ERROR Could not find Nx modules in this workspace in angular?
    2 replies
    Muhammad Ahsan Ayaz
    @AhsanAyaz
    Hey everyone!
    I'm working on a workspace that has a separate ionic and Angular app. Is it possible to run the ionic capacitor run android in an nx workspace somehow using existing schematics?
    Jeff
    @jpennal
    Anyone have issues with commands like nx build server --configuration=vnv hanging on a Bitbucket server? It's just spinning there with no output after
    nx build server --configuration=vnv
    > nx run server:build:vnv 
    Starting type checking service...
    Using 6 workers with 2048MB memory limit
    1 reply
    xjuanc
    @xjuanc
    Hello everyone! Has anyone gone through this error? Kind of new with NX and this is stopping me from moving forward:
    (node:14876) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\Users\NEXT\nextcorp\tsconfig.json'
        at Object.openSync (fs.js:476:3)
        at Object.readFileSync (fs.js:377:35)
        at Object.readJsonFile (C:\Users\NEXT\nextcorp\node_modules\@nrwl\tao\src\utils\fileutils.js:16:26) 
        at readRootTsConfig (C:\Users\NEXT\nextcorp\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:155:25)
        at createProjectGraph (C:\Users\NEXT\nextcorp\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:59:26)    
        at createProjectGraph (C:\Users\NEXT\nextcorp\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:59:26)
        at Object.<anonymous> (C:\Users\NEXT\nextcorp\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:40:16)
        at Generator.next (<anonymous>)
        at C:\Users\NEXT\nextcorp\node_modules\tslib\tslib.js:117:75
        at new Promise (<anonymous>)
        at Object.__awaiter (C:\Users\NEXT\nextcorp\node_modules\tslib\tslib.js:113:16)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:14876) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
    (node:14876) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    It happens after running: nx serve supernova-admin which is the name of my app
    Saujan Ghimire
    @sookah
    hi guys, how do you deploy individual angular 12 apps from nx monorepo to aws production? Is ECS, amplify or s3 the best way to go? Please help
    Dave Bush
    @DaveMBush

    @xjuanc the current version of node doesn't like the fact that you are not handling exceptions (reject) in promises. I'm assuming it is complaining about your code. I had a situation where I did not have easy access to the promise chain (and it was deep chain) that was causing the problem and so I finally used

    process.once(UNHANDLEDREJECTION, function to handle unhandled rejection here)

    before calling the offending code.

    I'm going to guess that once you do that, you may be able to track down what the real problem is by capturing the error information in the function you wrote to handle it.

    I know that's kind of sketchy, but you can lookup node and UNHANDLEDREJECTION on the search engines and get more details.


    xjuanc
    @xjuanc
    Thanks for the tip @DaveMBush, gonna track it down, I'm migrating my current angular app to nx so there are probably things I have to migrate to the versions used by NX, probably that's the reason. Thanks!
    Dave Bush
    @DaveMBush
    @xjuanc yeah, I'm in the middle of converting our seed project so I can sell it to my team.
    I'm particularly interested in StoryBook and breaking out the project into libraries, and eventually module federation
    Benny739
    @Benny739
    Where do you usually put shared guards or directives/components which need to access data but are also shared widely through the app? Is a shared feature the right thing here? E.g. a guard who checks if a user has specifc roles or a directive which unlocks features if the user has unlocked them.
    Yi Kan Mario Mui
    @mariomui
    I actually dont seperate it out that way. I seperate core and shared. Core has one instance and shared will have multiple instances. So i could have services or guards in eithet folder. Its more important that i distinguish which should be only instanced ONCE on app load and those that are instanced and deinstanced on number of components.
    I forgot to include an example. Sometimes i have a service that is hiearchally injected in in the module layer so only they know about their specific functions and data. So that would be in shared.
    RedskyGames
    @anna_69_1988_twitter
    Looking for a Dockerfile + docker-compose file for a nestjs/angular nx workspace for development. I'm not able to find one that works with reloading the nest app while in the docker container.
    Benny739
    @Benny739
    Can features usually import other features or is this considered a bad practice? I'm wondering where to put shared smart components
    1 reply
    Stoil Kostadinov
    @stoil

    Hi there does anyone experience the following issue:
    When you add a nextjs app to your workspace (no matter if you use typescript or plain js). When you run nx serve example-app and when you open the devtools of the browser and try to see the sources. The generated source maps does not point to the original source code but rather to some intermediary state where you can see the transpiled jsx syntax.

    Example:

    import { jsxs as _jsxs } from "react/jsx-runtime";
    import { jsx as _jsx } from "react/jsx-runtime";
    import styles from './index.module.css';
    export function Index() {
      /*
       * Replace the elements below with your own.
       *
       * Note: The corresponding styles are in the ./index.css file.
       */
      console.log('TEST');
      return /*#__PURE__*/_jsxs("div", {
        className: styles.page,
        children: [/*#__PURE__*/_jsx("h2", {
          children: "Resources & Tools"
        }), /*#__PURE__*/_jsx("p", {
          children: "Thank you for using and showing some \u2665 for Nx."
        }), /*#__PURE__*/_jsx("div", {
          className: "flex github-star-container",
          children: /*#__PURE__*/_jsxs("a", {
            href: "https://github.com/nrwl/nx",
            target: "_blank",
            rel: "noopener noreferrer",
            children: [' ', "If you like Nx, please give it a star:", /*#__PURE__*/_jsxs("div", {
              className: "github-star-badge",
              children: [/*#__PURE__*/_jsx("img", {
                src: "/star.svg",
                className: "material-icons",
                alt: ""
              }), "Star"]
            })]
          })
        }), /*#__PURE__*/_jsx("p", {
          children: "Here are some links to help you get started."
        }), /*#__PURE__*/_jsxs("ul", {
          className: "resources",
          children: [/*#__PURE__*/_jsx("li", {
            className: "col-span-2",
            children: /*#__PURE__*/_jsx("a", {
              className: "resource flex",
              href: "https://egghead.io/playlists/scale-react-development-with-nx-4038",
              children: "Scale React Development with Nx (Course)"
            })
          }), /*#__PURE__*/_jsx("li", {
            className: "col-span-2",
            children: /*#__PURE__*/_jsx("a", {
              className: "resource flex",
              href: "https://nx.dev/latest/react/tutorial/01-create-application",
              children: "Interactive tutorial"
            })
          }), /*#__PURE__*/_jsx("li", {
            className: "col-span-2",
            children: /*#__PURE__*/_jsxs("a", {
              className: "resource flex",
              href: "https://nx.app/",
              children: [/*#__PURE__*/_jsxs("svg", {
                width: "36",
                height: "36",
                viewBox: "0 0 120 120",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                children: [/*#__PURE__*/_jsx("path", {
                  d: "M120 15V30C103.44 30 90 43.44 90 60C90 76.56 76.56 90 60 90C43.44 90 30 103.44 30 120H15C6.72 120 0 113.28 0 105V15C0 6.72 6.72 0 15 0H105C113.28 0 120 6.72 120 15Z",
                  fill: "#0E2039"
                }), /*#__PURE__*/_jsx("path", {
                  d: "M120 30V105C120 113.28 113.28 120 105 120H30C30 103.44 43.44 90 60 90C76.56 90 90 76.56 90 60C90 43.44 103.44 30 120 30Z",
                  fill: "white"
                })]
              }), /*#__PURE__*/_jsx("span", {
                className: "gutter-left",
                children: "Nx Cloud"
              })]
            })
          })]
        }), /*#__PURE__*/_jsx("h2", {
          children: "Next Steps"
        }), /*#__PURE__*/_jsx("p", {
          children: "Here are some things you can do with Nx."
        }), /*#__PURE__*/_jsxs("details", {
          open: true,
          children: [/*#__PURE__*/_jsx("summary", {
            children: "Add UI library"
          }), /*#__PURE__*/_jsx("pre", {
            children: "# Generate UI lib\nnx g @nrwl/react:lib ui\n\n# Add a component\nnx g @nrwl/react:component xyz --project ui"
          })]
        }), /*#__PURE__*/_jsxs("details", {
          children: [/*#__PURE__*/_jsx("summary", {
            children: "View dependency graph"
          }), /*#__PURE__*/_jsx("pre", {
            children: "nx dep-graph"
          })]
        }), /*#__PURE__*/_jsxs("details", {
          children: [/*#__PURE__*/_jsx("summar
    Forgot to mention that this happens on windows with node v14.17.0 and @nrwl/next": "12.6.5" and "next": "11.0.1"
    Christian
    @anno1985
    Hi! I have a library where I want to add includePaths to my stylePreprocessorOptions so that in my scss file, shared styles from the app are available for import. I did add a build target to the lib's definition in angular.json, and that seemed to work fine, but the migration to nx 12 just failed, because my build target for that lib (that I introduced for just the purpose of adding the style preprocessor options) doesn't have a required? builder property. How would I do this properly (i.e. do I have to move the stylePreprocessorOptions elsewhere or add a builder or do something completely different)?
        "myLib": {
          "projectType": "library",
          // ...
          "architect": {
            "lint": {
              // ...
            },
            "build": {
              "options": {
                "stylePreprocessorOptions": {
                  "includePaths": ["apps/myApp/src/scss"]
                }
              }
            },
    Brandon Miller
    @millbj92
    Hey guys :)
    Just wanna say nx has made my life so much easier
    RNZ
    @Hakhenaton

    Hi everyone,
    I'm having some deprecation warnings after migratins to webpack 5, i'm using @nrwl/node executors to launch a NestJS app.
    I got these two warnings:

    (node:29740) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    (node:29740) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)

    Any idea ? thanks a lot and have a good day

    Brenden Niedermeyer
    @brenden-ef
    Anyone having issues using SCSS Modules with Storybook for a React library after upgrading to 12.7.1? Previously we were using the @storybook/preset-scss addon and now after following the migration instructions at https://nx-dev-git-refactor-react-storybook-setup-nrwl.vercel.app/preview/react/storybook/migrate-webpack-final it has a lot of compilation errors. Strangely enough our builds are unaffected though so this seems to be a strictly storybook problem. Wanted to check here before working on opening an issue.
    fwiw - this is our new main.js file after the migration - we didn't have any custom webpack configs previously
    const rootMain = require('../../../.storybook/main');
    
    module.exports = {
      ...rootMain,
    
      stories: [...rootMain.stories, '../src/lib/**/*.stories.mdx', '../src/lib/**/*.stories.@(js|jsx|ts|tsx)'],
      addons: [...rootMain.addons, '@nrwl/react/plugins/storybook', '@storybook/preset-scss'],
      webpackFinal: async (config, { configType }) => {
        // apply any global webpack configs that might have been specified in .storybook/main.js
        if (rootMain.webpackFinal) {
          config = await rootMain.webpackFinal(config, { configType });
        }
    
        // add your own webpack tweaks if needed
    
        return config;
      },
    };
    Brenden Niedermeyer
    @brenden-ef
    For anyone else that might run into this, the new storybook preset that comes in 12.7.1 takes care of the configuration for you. If you remove the preset @storybook/preset-scss everything works great.
    stefanorumi7
    @stefanorumi7
    Hi guys! So I am trying to write my own executor as I want to use nx in this project which uses mocha for testing. I have it already working in projects without references to other projects. But when the project has a reference i am getting this "Cannot find module '@foo/bar'" error. Does someone know how to do this project linking in a custom executor? Thanks for the help
    1 reply
    Sagato
    @Sagato
    Hi ppl. I have an issue with using angular 12 + nrwl + tailwindcss. The styles apply within the app and also within the lib, BUT the angular typical selectors'app-link' <app-link></app-link> they seem to "block the styling" if I have<app-sidenav><app-link></app-link></app-sidenav>then it ignores somehow the padding of the links. The height only content-fits the text.
    is it about viewencapsulation?
    Jay
    @mastakillahBlitzar
    Hi everyone, getting trouble using the ng g command
    i think is looking for angular.json, but those definitons are now in workspace.json?
    sevenposchnappi
    @sevenposchnappi
    nrwl/nx#738
    Hi ppl, is this issue have a better solution? is possible that import path can set root for each apps. thanks.
    Thái Nguyễn Hoàng Quốc
    @tnohtition:matrix.org
    [m]

    hi folks, I am quite new in nrwl, I am using nrwl 12.7 on React and I want to use feature like Absolute Import in an application. I have made a change at tsconfig.app.json like

    "compilerOptions": {
        "outDir": "../../dist/out-tsc",
        "types": ["node"],
        "baseUrl": ".",
        "paths": {
          "@/*": ["/*"]
        }
      },

    but it doesn't work, anybody know how to implement Absolute Import from nwrl at application level?

    MickeL
    @MickeL
    Hi, when i generate a angular workspace there is no workspace.json file created, is this by design or ?
    Simon
    @Ponjimon
    $ yarn nx g @nrwl/nest:library foo
    Could not format tsconfig.base.json. Error: "';' expected. (2:18)
      1 | {
    > 2 |   "compileOnSave": false,
        |                  ^
      3 |   "compilerOptions": {
      4 |     "rootDir": ".",
      5 |     "sourceMap": true,"
    Could not format workspace.json. Error: "';' expected. (2:12)
      1 | {
    > 2 |   "version": 2,
        |            ^
      3 |   "projects": {
      4 |     "api": {
      5 |       "root": "apps/api","
    Could not format nx.json. Error: "';' expected. (2:13)
      1 | {
    > 2 |   "npmScope": "fsaero",
        |             ^
      3 |   "affected": {
      4 |     "defaultBase": "main"
      5 |   },"
    Could not format libs/foo/README.md. Error: "Invalid character. (1:2)
    > 1 | # foo
        |  ^
      2 |
      3 | This library was generated with [Nx](https://nx.dev).
      4 |"
    Could not format libs/foo/.babelrc. Error: "';' expected. (2:12)
      1 | {
    > 2 |   "presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
        |            ^
      3 | }
      4 |"
    Could not format libs/foo/tsconfig.json. Error: "';' expected. (2:12)
      1 | {
    > 2 |   "extends": "../../tsconfig.base.json",
        |            ^
      3 |   "files": [],
      4 |   "include": [],
      5 |   "references": ["
    Could not format libs/foo/tsconfig.lib.json. Error: "';' expected. (2:12)
      1 | {
    > 2 |   "extends": "./tsconfig.json",
        |            ^
      3 |   "compilerOptions": {
      4 |     "module": "commonjs",
      5 |     "outDir": "../../dist/out-tsc","
    Could not format libs/foo/.eslintrc.json. Error: "';' expected. (2:12)
      1 | {
    > 2 |   "extends": [
        |            ^
      3 |     "../../.eslintrc.json"
      4 |   ],
      5 |   "ignorePatterns": ["
    Could not format libs/foo/tsconfig.spec.json. Error: "';' expected. (2:12)
      1 | {
    > 2 |   "extends": "./tsconfig.json",
        |            ^
      3 |   "compilerOptions": {
      4 |     "outDir": "../../dist/out-tsc",
      5 |     "module": "commonjs","
    CREATE libs/foo/README.md
    CREATE libs/foo/.babelrc
    CREATE libs/foo/src/index.ts
    CREATE libs/foo/tsconfig.json
    CREATE libs/foo/tsconfig.lib.json
    UPDATE tsconfig.base.json
    UPDATE workspace.json
    UPDATE nx.json
    CREATE libs/foo/.eslintrc.json
    CREATE libs/foo/jest.config.js
    CREATE libs/foo/tsconfig.spec.json
    CREATE libs/foo/src/lib/foo.module.ts
    Is there a reason why I get this error? How can I fix this?
    1 reply
    Jacques Lareau
    @jacqueslareau
    hi, lets says i have some scripts that do maintenance stuff on scheduled time (ie not services), where would that fit in nx? should i create an app for each scripts?
    Michael Robson
    @AJRobson1
    Hi, I'm wondering if anyones managed to gete cucumber tags working in NX? I have cucumber yet up but I'd like to be able to run features based on the tags.
    RB
    @BhaskaranR
    :point_up: July 23, 2020 7:49 AM did you find a solution how to do custom next:server?
    agentx-cgn
    @agentx-cgn
    Hi, is there a tutorial on how to get from create-nx-workspace to ng add @angular-architects/module-federation? I'm stuck with 'The add command requires to be run in an Angular project, but a project definition could not be found.'
    1 reply
    masaanli
    @masaanli

    Just have a quick question. Having NX with several apps (40x) and a lot of libs.

    Now when creating an app everything is named like: app.component. and the component itself is named like AppComponent but you can imagine if you have 40 apps with all named AppComponent it's ...........

    What is suggested? Prefix filename and the component ?

    1 reply
    Andy Boyd
    @StephenABoyd

    Hello,
    I'm currently converting to Nx, and we are almost completed with the conversion. We are Angular/Nx v9 currently.

    In our root dir tsconfig.json, where we have all our path alias's, that seems to be causing every project to be affected by every other project (whole dep graph goes red on any change). When I remove those paths in the affected base, then affected starts working correctly.

    One thing that works is creating a tsconfig.base.json, and then remove the tsconfig.json. However, the generators break with this as they are expecting a tsconfig.json.

    I'm curious if anyone knows why having the path alias's in the tsconfig.json is marking everything as "affected"?

    Nelson Bwogora
    @nelsonBlack
    is there an nx discord server ?
    1 reply