-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
fix: use posix separators when adding assets to the compilation #389
Conversation
What is happening is webpack's `MemoryFileSystem` will contain below entries ``` MemoryFileSystem { data: { _karma_webpack_: { '': true, 'main.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'polyfills.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'polyfills-es5.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'styles.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'vendor.js': <Buffer 28 77 69 6e 64 6f 77 5b 22 77 65 62 70 61 63 6b 4a 73 6f 6e 70 22 5d 20 3d 20 77 69 6e 64 6f 77 5b 22 77 65 62 70 61 63 6b 4a 73 6f 6e 70 22 5d 20 7c ... >, 'favicon.ico': <Buffer 00 00 01 00 02 00 10 10 00 00 00 00 20 00 68 04 00 00 26 00 00 00 20 20 00 00 00 00 20 00 a8 10 00 00 8e 04 00 00 28 00 00 00 10 00 00 00 20 00 00 00 ... >, assets: [Object], 'assets\\test.json': <Buffer 7b 0d 0a 20 20 22 74 65 73 74 22 3a 20 74 72 75 65 0d 0a 7d 0d 0a> } } } ``` Instead of ``` MemoryFileSystem { data: { _karma_webpack_: { '': true, 'main.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'polyfills.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'polyfills-es5.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'styles.js': <Buffer 2f 2a 2a 2a 2a 2a 2a 2f 20 28 66 75 6e 63 74 69 6f 6e 28 6d 6f 64 75 6c 65 73 29 20 7b 20 2f 2f 20 77 65 62 70 61 63 6b 42 6f 6f 74 73 74 72 61 70 0a ... >, 'vendor.js': <Buffer 28 77 69 6e 64 6f 77 5b 22 77 65 62 70 61 63 6b 4a 73 6f 6e 70 22 5d 20 3d 20 77 69 6e 64 6f 77 5b 22 77 65 62 70 61 63 6b 4a 73 6f 6e 70 22 5d 20 7c ... >, 'favicon.ico': <Buffer 00 00 01 00 02 00 10 10 00 00 00 00 20 00 68 04 00 00 26 00 00 00 20 20 00 00 00 00 20 00 a8 10 00 00 8e 04 00 00 28 00 00 00 10 00 00 00 20 00 00 00 ... >, assets: [Object] } } } ``` When someone calls `context.fs.statSync('/_karma_webpack_/assets/test.json');` it will throw an error that the file cannot be found.
@evilebottnawi, gentle reminder. |
@alan-agius4 duplicate #378? |
Yeah seems so! Can we get some priority in getting that merged? Thanks
…On Wed, 03 Jul 2019 at 12:28, Evilebot Tnawi ***@***.***> wrote:
@alan-agius4 <https://github.com/alan-agius4> duplicate #378
<#378>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#389?email_source=notifications&email_token=AEF74WQL4A5G6IXNPITFIHDP5R5ORA5CNFSM4H2QRVA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZEARTI#issuecomment-508037325>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEF74WWXMUW25Z6R4YLCXP3P5R5ORANCNFSM4H2QRVAQ>
.
|
@alan-agius4 in todo |
Thanks, feel free to close this PR.
…On Wed, 03 Jul 2019 at 12:41, Evilebot Tnawi ***@***.***> wrote:
@alan-agius4 <https://github.com/alan-agius4> in todo
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#389?email_source=notifications&email_token=AEF74WV774TUZMIPOPLPE63P5R66LA5CNFSM4H2QRVA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZEBN2A#issuecomment-508040936>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEF74WWCKC2UVW4LJ7PIKOLP5R66LANCNFSM4H2QRVAQ>
.
|
@alan-agius4 i am afraid break this #347, can you create minimum reproducible test repo? |
There is a minimal reproduction in this issue angular/angular-cli#14593 Repo link https://github.com/plchampigny/ng8-test-assets You can run the following command to get the error Note this problem only occurs on non posix filesystems because of the above explained issue. The execution is thrown from https://github.com/webpack/webpack-dev-middleware/blob/ec3d5eb3de8db8853d248e8192961f5ca901bb2c/lib/middleware.js#L66-L93 |
@evilebottnawi Any idea if/when this will be merged? For now, this is blocking folks who rely on assets from being able to update to Angular 8. |
@brian428 next week |
What is happening is webpack's
MemoryFileSystem
will contain below entriesInstead of
When someone calls
context.fs.statSync('/_karma_webpack_/assets/test.json');
it will throw an error that the file cannot be found.This PR contains a:
Motivation / Use-Case
Breaking Changes
Additional Info