Skip to content

Production build fails if styles directory is a hard link #5167

@gavinm-ulogic

Description

@gavinm-ulogic

Please provide us with the following information:

OS?

Windows 10

Versions.

@angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.32-3]
node: 7.3.0
os: win32 x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/cli: 1.0.0-beta.32.3
@angular/compiler-cli: 2.4.7

Repro steps.

1.) Move directory containing styles to different location.
2.) Create hard link (junction) with mklink /J {source} {target} - map link back to original position

The log given by the failure.

ERROR in TypeError: Cannot read property 'match' of undefined

  • suppress-entry-chunks-webpack-plugin.js:40 filterFn
    [External]/[@angular]/cli/plugins/suppress-entry-chunks-webpack-plugin.js:40:91

  • Array.filter

  • suppress-entry-chunks-webpack-plugin.js:42 Compilation.compilation.plugin
    [External]/[@angular]/cli/plugins/suppress-entry-chunks-webpack-plugin.js:42:59

  • Tapable.js:208 Compilation.applyPluginsAsyncWaterfall
    [External]/[tapable]/lib/Tapable.js:208:13

  • util.js:16 Compilation.tryCatcher
    [External]/[bluebird]/js/release/util.js:16:23

  • index.js:642
    [External]/[html-webpack-plugin]/index.js:642:12

  • index.js:152
    [External]/[html-webpack-plugin]/index.js:152:16

  • util.js:16 tryCatcher
    [External]/[bluebird]/js/release/util.js:16:23

  • promise.js:510 Promise._settlePromiseFromHandler
    [External]/[bluebird]/js/release/promise.js:510:31

  • promise.js:567 Promise._settlePromise
    [External]/[bluebird]/js/release/promise.js:567:18

  • promise.js:612 Promise._settlePromise0
    [External]/[bluebird]/js/release/promise.js:612:10

  • promise.js:691 Promise._settlePromises
    [External]/[bluebird]/js/release/promise.js:691:18

  • async.js:133 Async._drainQueue
    [External]/[bluebird]/js/release/async.js:133:16

  • async.js:143 Async._drainQueues
    [External]/[bluebird]/js/release/async.js:143:10

  • async.js:17 Immediate.Async.drainQueues
    [External]/[bluebird]/js/release/async.js:17:14

Mention any other details that might be useful.

As per the trace the error occurs at:
suppress-entry-chunks-webpack-plugin.js:40:91
updating that line to:
const filterFn = (tag) => !(tag.tagName === 'script' && tag.attributes.src && tag.attributes.src.match(/.css$/));
stops the error and doesn't seem to effect my build - but guess that lack of tag.attributes.src would cause errors in some builds

For background:
The reason I want to do this is to allow for multiple styles and assets directories that I can switch in and out for different look & feel builds - if there's a better way to achieve this I'd be happy to change.

Thanks Gavin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions