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

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

Closed
johnpapa opened this issue May 4, 2018 · 8 comments
Closed
Labels
freq1: low Only reported by a handful of users who observe it rarely P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful severity3: broken

Comments

@johnpapa
Copy link
Contributor

johnpapa commented May 4, 2018

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

@johnpapa
Copy link
Contributor Author

johnpapa commented May 4, 2018

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.

@filipesilva
Copy link
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.

@filipesilva filipesilva added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful severity3: broken comp: cli/update freq1: low Only reported by a handful of users who observe it rarely and removed comp: cli/build labels May 4, 2018
@filipesilva
Copy link
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!

@filipesilva
Copy link
Contributor

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

@devarg
Copy link

devarg commented May 4, 2018

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

@filipesilva filipesilva changed the title ng update @angular/cli not working - Path is Invalid ng update @angular/cli with allowOutsideOutDir not working - Path is Invalid May 4, 2018
@elvisbegovic
Copy link
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

@ramandeep-singh-1983
Copy link

ramandeep-singh-1983 commented May 7, 2018

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.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freq1: low Only reported by a handful of users who observe it rarely P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful severity3: broken
Projects
None yet
Development

No branches or pull requests

5 participants