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

Global styles and scripts are not injected if project path includes a junction #2726

Closed
tallaxes opened this issue Oct 16, 2016 · 2 comments · Fixed by #6403
Closed

Global styles and scripts are not injected if project path includes a junction #2726

tallaxes opened this issue Oct 16, 2016 · 2 comments · Fixed by #6403
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@tallaxes
Copy link

tallaxes commented Oct 16, 2016

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.17
node: 6.6.0
os: win32 x64

Repro steps.

mkdir scratch
cd scratch
ng new proj
cd ..
mklink /j scratch-link scratch    # creates a junction
cd scratch\proj
ng build

The log given by the failure.

The global styles (src\styles.css) won't be injected, the resulting dist\styles.bundle.js won't have any trace of style-loader. I think the same thing will happen with global scripts, but I focused on styles.

Mention any other details that might be useful.

(Junction is one flavor of symbolic link on Windows; have not tested with other kinds. I would not be surprised if the same thing happens with symbolic or hard links on Linux, but I have not tested.)

The problem is related to the webpack configuration, specifically the include check for the global files that need to be included for style-loader/script-loader processing. The file names used to build the configuration (styles and scripts arrays) are derived from the project location and don't reflect anything about the junction. The resource names passed in by webpack for matching at runtime, however, are normalized (presumably with something like fs.realpath) and point to the original location of the files. Consequently, file names that should be selected for special processing are not matched.

It is possible that it is webpack that should process file names in the configuration in the same way it normalizes the names of the resources passed in. Or, at the CLI level, file names in the config could be normalized with fs.realpathSync. Or one can just avoid using links.

@filipesilva filipesilva added type: bug/fix command: build P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Oct 17, 2016
@filipesilva filipesilva self-assigned this Oct 17, 2016
@hansl hansl modified the milestone: RC1 Nov 11, 2016
@Shavindra
Copy link

Shavindra commented Feb 8, 2017

We are experiencing same. SCSS files get bundled up but it's missing the style loader modules in the styles.bundle.js. So they never get injected when running the app.

@hansl hansl removed this from the RC1 milestone May 2, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 22, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 22, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this issue May 24, 2017
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants