Closed jebbench closed 3 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it!
Is there anything outstanding that would prevent this from being merged in? This fixed the issue I was having with the mentioned auth0 library.
Seconding @dcantu476. Angular will not build unless I update this manually.
@developit Can you merge this PR? Would really appreciate it! :)
Can you please merge this :) ? @developit
it causes also some problem with Web workers
steps:
export class WebWorker {
protected worker;
constructor(url: string, options?: WorkerOptions) {
this.worker = new Worker(url, options);
return this.worker;
}
}
use it in the app.component.ts
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
title = 'angular-tour-of-heroes';
result: string;
ngOnInit() {
const ww = new WebWorker('./app.y-worker', { type: 'module' });
if (typeof Worker !== 'undefined') {
const worker = new Worker('./app.y-worker', { type: 'module' });
worker.onmessage = ({ data }) => {
console.log(`page got message: ${data}`);
this.result = `page got message: ${data}`;
};
worker.postMessage('hello');
} else {
// Web Workers are not supported in this environment.
// You should add a fallback so that your program still executes correctly.
}
}
}
The project wont compile
ERROR in ./src/app/randomname.ts
Module parse failed: Cannot read property 'length' of undefined
File was processed with these loaders:
* ./node_modules/@ngtools/webpack/src/index.js
You may need an additional loader to handle the result of these loaders.
TypeError: Cannot read property 'length' of undefined
at /home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/worker-plugin/dist/worker-plugin.js:64:44
at SyncBailHook.eval [as call] (eval at create (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
at Parser.walkNewExpression (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1822:25)
at Parser.walkExpression (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1613:10)
at Parser.walkAssignmentExpression (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1793:8)
at Parser.walkExpression (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1583:10)
at Parser.walkExpressionStatement (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1022:8)
at Parser.walkStatement (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:964:10)
at Parser.walkStatements (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:868:9)
at /home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1017:9
at Parser.inBlockScope (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:2060:3)
at Parser.walkBlockStatement (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1014:8)
at Parser.walkStatement (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:949:10)
at /home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1702:10
at Parser.inFunctionScope (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:2043:3)
at Parser.walkFunctionExpression (/home/vm/to_delete/angular/angular-tour-of-heroes/node_modules/webpack/lib/Parser.js:1695:8)
more details can be found here:
Apologies for taking so long to merge this.
Fix for https://github.com/GoogleChromeLabs/worker-plugin/issues/93
Checks that optsExpr.properties is defined.