by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Raziel
    @rraziel
    So I guess it's to save on some ../.. and similar?
    Eli Perelman
    @eliperelman
    yeah, sets imports relative to the root source
    ill play around with the root paths and see if i can make it work and report back
    Raziel
    @rraziel
    If you add "*" at the end of the list of paths, it doesn't work?
    (although it's not a list so the order shouldn't matter)
    Eli Perelman
    @eliperelman
    the tough part is the double wildcard
    "@project/api-schema": ["libs/api-schema/src/index.ts"],
    "@/*": ["apps/*/src/*"]
    Raziel
    @rraziel
    I think it's just "*"
    But yeah not sure how you'd split the match
    Eli Perelman
    @eliperelman
    lol thats what i was afraid of
    Raziel
    @rraziel
    Although "@/*": "apps/*/src" could work I think
    Eh
    Nah nvm
    Eli Perelman
    @eliperelman
    i guess the other uglier option would be to copy paths from the root tsconfig to each project's tsconfig
    Raziel
    @rraziel
    Or use @app/xx instead of @/xx
    Eli Perelman
    @eliperelman
    right right
    Raziel
    @rraziel
    (or do like everyone else with relative paths :D)
    Eli Perelman
    @eliperelman
    lol
    Raziel
    @rraziel
    Doesn't nx have a lint error when you use the path alias in the module it refers to?
    Eli Perelman
    @eliperelman
    no, i use eslint and along with fork-ts-checker-webpack-plugin so they are all integrated and have knowledge of paths and aliases
    Raziel
    @rraziel
    I meant workspace-lint
    And the warning is because it knows about paths and aliases and says you shouldn't be doing it ;)
    Eli Perelman
    @eliperelman
    i have workspace lint set to only check files that arent part of a project's source
    Raziel
    @rraziel
    Oh well, back to work \o/
    Eli Perelman
    @eliperelman
    hehe, thank you so much for the help! i think copying into each project-specific tsconfig is the way ill go :)
    Tom McKearney
    @tommck
    All, I'm trying to use NgUpgrade with my old AngularJS app in a lazy loaded library... Do I need to load angular itself at the beginning anyway so I can downgrade the root element to AngularJS for this to work?
    Marc Höffl
    @KeKs0r

    Hi, I am new to gitter and just recently started using nx. I have migrated my app to it over the last 2 days (500+ files). Now I am trying to reproduce my previous dev environemnt.

    I was able to run my app locally in dev as well as in prod. prod is not only a production build, but when local it also connects into the production environment to debug with production data. This is achieved with a dedicated .env file. How do i tell the node builder to run the serve command with a specific envFile? I saw that workspace run-command does have this option, but noth sure how to provide it with the node builder.

    Derek
    @derekkite
    @KeKs0r in the angular.json configuration file, in the specific app configuration section there is a filereplace setting.
    Marc Höffl
    @KeKs0r
    @derekkite I saw the filereplace setting, but does it work with .env files?
    Marc Höffl
    @KeKs0r
    As well as the @nrwl/node:execute does not seem to take that argument. I can only pass a different buildTarget which I need to do to get the production build. But I dont want the production build, but rather just a dev build with different environment variables
    Marc Höffl
    @KeKs0r
    --> I ended up doing it via a different script : env-cmd -f .production.env nx serve graph-api
    Raziel
    @rraziel
    Never understood the point of using those, I just have a config.json and a single build with empty environment.ts files
    Till
    @ruohki
    is it possible that the @nrwl/react package does not support decorators (setting the flags in the tsconfig dont help)
    Marc Höffl
    @KeKs0r

    Does anyone have a good way of just executing a script file within a lib?
    lets say I have a ts file within a lib:

    import * as _ from "lodash";
    
    run();
    function run() {
      _.map(['a'], (a) => console.log(a))
    }

    I am trying to execute it via ts-node

            "example": {
              "builder": "@nrwl/workspace:run-commands",
              "options": {
                "command": "yarn ts-node libs/admin/src/scripts/test-script.ts -s"
              }
            }

    But I am getting the following error:

    import * as _ from "lodash";
    ^^^^^^
    
    SyntaxError: Cannot use import statement outside a module
    Marc Höffl
    @KeKs0r

    Maybe I should rephrase:

    how do you folks run arbitrary scripts in your projects?

    Manuel Bojato
    @KingDarBoja
    I have the same question
    But now the second question still waiting for some insight, I read this cooment at https://github.com/nrwl/nx/issues/1089#issuecomment-484036298 but not sure how to use it and where should I put it
    I remember I asked something like that before Marc
    Luis Vargas
    @luisvt
    Hello creating a new project with Angular 10 get next error:
     create-nx-workspace 9.5.1
    ? Workspace name (e.g., org name)     simple-chat
    ? What to create in the new workspace angular-nest      [a workspace with a full stack application (Angular + Nest)]
    ? Application name                    client
    ? Default stylesheet format           SASS(.scss)  [ http://sass-lang.com   ]
    ? Use the free tier of the distributed cache provided by Nx Cloud? No  [Only use local computation cache]
    Creating a sandbox with Nx...
    new simple-chat --preset="angular-nest" --appName="client" --style="scss" --interactive=false --collection=@nrwl/workspace
    CREATE simple-chat/nx.json (513 bytes)
    CREATE simple-chat/tsconfig.json (509 bytes)
    CREATE simple-chat/README.md (3407 bytes)
    CREATE simple-chat/.editorconfig (245 bytes)
    CREATE simple-chat/.gitignore (503 bytes)
    CREATE simple-chat/.prettierignore (74 bytes)
    CREATE simple-chat/.prettierrc (26 bytes)
    CREATE simple-chat/angular.json (96 bytes)
    CREATE simple-chat/package.json (1268 bytes)
    CREATE simple-chat/decorate-angular-cli.js (3093 bytes)
    CREATE simple-chat/tools/tsconfig.tools.json (218 bytes)
    CREATE simple-chat/tools/schematics/.gitkeep (0 bytes)
    CREATE simple-chat/apps/.gitkeep (0 bytes)
    CREATE simple-chat/libs/.gitkeep (0 bytes)
    ✔ Packages installed successfully.
    /bin/sh: 1: ./node_modules/.bin/ng: not found
    Workspace creation failed, see above.
    (node:6568) UnhandledPromiseRejectionWarning: Error: Command failed: "/tmp/tmp-6568uTgi4X6nEAny/node_modules/.bin/ng" new simple-chat --preset="angular-nest" --appName="client" --style="scss" --interactive=false --collection=/tmp/tmp-6568uTgi4X6nEAny/node_modules/@nrwl/workspace/collection.json
        at checkExecSyncError (child_process.js:616:11)
        at Object.execSync (child_process.js:652:15)
        at createApp (/home/luis/.npm/_npx/6203/pnpm-global/4/node_modules/.pnpm/create-nx-workspace@9.5.1/node_modules/create-nx-workspace/bin/create-nx-workspace.js:366:21)
        at /home/luis/.npm/_npx/6203/pnpm-global/4/node_modules/.pnpm/create-nx-workspace@9.5.1/node_modules/create-nx-workspace/bin/create-nx-workspace.js:85:25
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:6568) 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: 1)
    (node:6568) [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.
    what am I doing wrong?
    Robin Van den Broeck
    @robinvdb_gitlab
    Does anybody know how to inject global scss in a Storybook (using angular 9)
    Si
    @Tatamethues
    hello, the proxy of react project doesn't work. anyone know why?
    Eran Sakal
    @esakal

    Hello
    I'm using @nrwl/web:build to build react application. I'm not sure what was the change that I did but when building to production I'm stuck on

    Starting type checking service...
    Using 2 workers with 2048MB memory limit

    Since the log is emitted only after the build ends I don't know what is causing it to hang.

    1. building without production flag works
    2. adding --verbose flag is not propagated to the actual nx build
    3. trying --memoryLimit=4096 doesn't fix it

    Please help

    Eran Sakal
    @esakal

    Setting sourceMap: false and extractCss:false fixed it but obviously i need source maps. regarding extract css, maybe it will work regardless to its value but it doesn't bother me disabling it.

    how can I debug and fix source map issue?

    Mohi 🦀
    @mohijalili_twitter
    I got this error when i want to migrate from workspace@8.8.2 to latest.
    Invalid Version: 5.2
    ~/node_modules/@nrwl/workspace/node_modules/yargs/yargs.js:1109
          else throw err
               ^
    
    Error: Command failed: ./node_modules/.bin/tao migrate @nrwl/workspace
    merry75
    @merry75
    hello
    is it possible to lazy load a react lib application to an angular application ?
    if yes could you point me to example or different ways to achieve it ?
    Christopher Dieringer
    @cdaringe
    hey friends :wave: i have a buildable library for web. it's entirely custom, built with some shell scripts :facepalm:. when my next.js builder executes (the nrwl arch), i want my built artifacts from dist/ to be resolved, as it's buildable! however, i'm not seeing configuration options to say "hey, next builder--use built stuff vs lib/<my-lib>/src".
    Christopher Dieringer
    @cdaringe
    ...or rather, what i need to do to hint to next that my custom lib is infact buildable. (i thought just having a build step was that)