Skip to content

ng update @angular/cli with allowOutsideOutDir not working - Path is Invalid #10647

Closed

Description

@johnpapa

Versions


Angular CLI: 6.0.0
Node: 8.11.1
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@angular/cdk                      5.2.4
@angular/material                 5.2.4
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

  • create an angular app with a src of /src/client
  • create a folder src/server (this is where i could put a node server)
  • add this to your package.json inside of apps, assets.
        {
          "glob": "**/*.*",
          "input": "../server/",
          "output": "../",
          "allowOutsideOutDir": true
        },
        {
          "glob": "package.json",
          "input": "../../",
          "output": "../",
          "allowOutsideOutDir": true
        }
  • run ng update @angular/cli

Observed behavior

▶ng update @angular/cli
            Updating karma configuration
            Updating configuration
Path "/../" is invalid.

Mention any other details that might be useful (optional)

I removed those allowOutsideOutDir entries and it seems to work. But I think it should work with them.

cc @filipesilva

Activity

  1. johnpapa commented on May 4, 2018

    @johnpapa
    ContributorAuthor

    it seems allowOutsideOutDir has been removed.

    I recommend someting in the changelog, the upgrade guide, and a mlog message in the console when running the update command ... thise wil help folks know whats up

    i do not see any reference to it in the changelog. but i see this issue #9363

    Any guidance is appreciated.

  2. filipesilva commented on May 4, 2018

    @filipesilva
    Contributor

    I think we should both show a warning on the release notes, and also show a warning during ng update about those assets entries.

  3. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    freq1: lowOnly reported by a handful of users who observe it rarely
    and removed on May 4, 2018
  4. filipesilva commented on May 4, 2018

    @filipesilva
    Contributor

    @devarg I don't think your comment is related to the issue shown here by @johnpapa. Can you instead open a new issue? Thanks!

  5. filipesilva commented on May 4, 2018

    @filipesilva
    Contributor

    Added a Breaking Changes section to https://github.com/angular/angular-cli/releases/tag/v6.0.0, with this change listed.

  6. devarg commented on May 4, 2018

    @devarg

    @filipesilva I'm sorry you are right, build the issue has been moved to to issue 10649

  7. changed the title [-]ng update @angular/cli not working - Path is Invalid[/-] [+]ng update @angular/cli with `allowOutsideOutDir ` not working - Path is Invalid[/+] on May 4, 2018
  8. elvisbegovic commented on May 4, 2018

    @elvisbegovic
    Contributor

    @johnpapa can you please search before open issue #10350

    It is not first time you open this one #8122

    While this already exist #7773

    Thanks

  9. ramandeep-singh-1983 commented on May 7, 2018

    @ramandeep-singh-1983

    Since allowOutsideOutDir has been removed, what all options do i have?
    @johnpapa i followed your guide to setup my project and my server is in src/server directory and it gets packaged in dist/ directory and my client app gets packaged in dist/public directory.

    How can i migrate to Angular CLI 6.0.0 in this case when allowOutsideOutDir has been removed? As per this comment (#9363 (comment)), it seems that outside directories are working without this option now

    Edit 1: The 'Path "/../" is invalid' error is not helpful at all. I am trying to migrate my 5.2.* project to 6.0.0 and i get this error while running the following command, it should at least give the file name and line number with the problem.

    PS D:\Work\git_repos\ccw\client-app> ng update @angular/cli
    Updating karma configuration
    Updating configuration
    Path "/../" is invalid.

    Edit 2: I was able to resolve the 'Path "/../" is invalid error but not able to solve the main issue with it. I followed @johnpapa 's article and had the following in my .angular-cli.json:

    "apps": [ { "root": "src/client", "outDir": "dist/public", "assets": [ "assets", "favicon.ico", { "glob": "index.js", "input": "../server/", "output": "../", "allowOutsideOutDir": true }, { "glob": "package.json", "input": "../server/", "output": "../" , "allowOutsideOutDir": true }, { "glob": "web.config", "input": "../server/", "output": "../", "allowOutsideOutDir": true }, "msal.js" ],

    The error comes because of this line: "output": "../". If i make it "output": "./", it works. Now, with allowOutsideOutDir support removed, i am not sure how i can deploy my client to dist/public and server to dist/

    Edit 3: I used a workaround to make it work for now:
    Specified "output" as "output": "./../" instead of "output": "../" as the code in common.js checks for strings beginning with "../". I really hope there is an option of making it work otherwise i will have to mix the server and client code in the same directory in the dist folder.

  10. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulfreq1: lowOnly reported by a handful of users who observe it rarelyseverity3: broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions