fix(@ngtools/webpack): allow # in paths - #9141
Conversation
|
@filipesilva I don't really understand what / why it's failing? And locally my tests seem to fail even without me making any modifications at all (ie running tests on master fails as well) |
|
I'm not sure which tests fail locally for you, but I think master is still passing CI. I restarted a couple of jobs on the latest master build and they still passed. The error CI is showing isn't related to You can run just this e2e test by doing
I checked out your PR locally and tried to reproduce. Indeed after I added a This breaks because the I think your fix also would produce a bad So for I think the correct algorithm is to split using |
|
Sorry for the (extreme) delay in replying, it's been hectic at work. You're right about the fact that I don't include the filename in the class ( function entryModule(_entryModule) {
if (!_entryModule) {
return undefined;
}
const splitted = _entryModule.split(/(#[a-zA-Z]+)/);
const path = splitted[0];
let className = splitted[1] || 'default';
if (splitted.length >= 3) {
className = splitted[splitted.length - 2];
}
return { path, className };
}
const testPath1 = '/my/path#to/project/src/app/app.module.ts#AppModule';
const testPath2 = 'E:\C#46\trunk\DataRouting\Customer\AAA\TruckRegistration\Frontend';
console.info('Path 1:', entryModule(testPath1));
console.info('Path 2:', entryModule(testPath2));Which yields the following results in repl.it: But I should get the filename in the class output as well, I'll try to get on that as soon as possible (I have been assigned a different project for now so it might take a while I'm afraid). EDIT: just noticed that your example with the path ( function entryModule(_entryModule) {
if (!_entryModule) {
return undefined;
}
const splitted = _entryModule.split(/(#[a-zA-Z]+)$/);
const path = splitted[0];
const className = splitted[1] || 'default';
return { path, className };
}
const testPath1 = '/my/path#to/project/src/app/app.module.ts#AppModule';
const testPath2 = 'E:C#46\trunkDataRoutingCustomerAAATruckRegistrationFrontend';
console.info('Path 1:', entryModule(testPath1));
console.info('Path 2:', entryModule(testPath2));Which yields the following output: Your suggestion indeed fixed splitting the path halfway, but it seems we still need to get the filename in there. |
|
@filipesilva The RegExp you suggested works fine I just had removed the leading |
|
Guess I'll close this in favour of #9236 since it's got cleaner history and I see myself having the time to fix this today (or any time this week) with this crazy schedule. Thanks @Taha-Di-Nero |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |



Possible fix for #9100 by only splitting on # when it's followed by a valid classname
(This time commits are done with the correct email address)