You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create some typescript file (test.ts) and require it using worker-loader, for example in app.component.ts:
let Worker = require('worker-loader!./test.ts');
and try to create it in constructor:
constructor() {
const worker = new Worker();
}
The log given by the failure.
Uncaught Error: Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (E:\project\upd\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (E:\project\upd\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (E:\project\upd\node_modules@ngtools\webpack\src\loader.js:350:33)
Mention any other details that might be useful.
Worked before cli switched to own ts loader, works fine when override loaders in require with own ts-loader like "require('!!worker-loader!ts-loader!./test.ts')" until required file has some imports which is loaded using cli loader again, probably any way to override inner requires globally on worker-loader require ?
What's expected solution to load worker files using cli ?
The text was updated successfully, but these errors were encountered:
OS?
Windows 10
Versions.
@angular/cli: 1.0.0-beta.32.3 (e)
node: 7.5.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.
let Worker = require('worker-loader!./test.ts');
and try to create it in constructor:
constructor() {
const worker = new Worker();
}
The log given by the failure.
Uncaught Error: Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (E:\project\upd\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (E:\project\upd\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (E:\project\upd\node_modules@ngtools\webpack\src\loader.js:350:33)
Mention any other details that might be useful.
Worked before cli switched to own ts loader, works fine when override loaders in require with own ts-loader like "require('!!worker-loader!ts-loader!./test.ts')" until required file has some imports which is loaded using cli loader again, probably any way to override inner requires globally on worker-loader require ?
What's expected solution to load worker files using cli ?
The text was updated successfully, but these errors were encountered: