Angular AOT & Rollup [!] Error: Unexpected token

598 views Asked by At

I'm following https://angular.io/guide/aot-compiler tutorial, everything goes fine till rollup section.

When i run:

"node_modules/.bin/rollup"  -c rollup-config.js

I get those errors:

The following options have been renamed — please update your config: options.entry -> options.input, options.dest -> options.output.file, options.format -> options.output.format

src/main.ts → src/build.js...
The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string
[!] Error: Unexpected token
aot\src\app\app.module.ngfactory.ts (43:57)
41: import * as import32 from './all-holiday-requests/all-holiday-requests.component.ngfactory';
42: import * as import33 from '../../../src/app/app.component';
43: class AppModuleInjector extends import0.ɵNgModuleInjector<import1.AppModule> {
                                                             ^
44:   _NgProbeToken_2:any[];
45:   _ɵg_3:import2.ɵg;

Before that i was getting this:

The following options have been renamed — please update your config: options.entry -> options.input, options.dest -> options.output.file, options.format -> options.output.format

src/main.ts → src/build.js...
The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string
[!] Error: Could not resolve '../aot/src/app/app.module.ngfactory' from src\main.ts
Error: Could not resolve '../aot/src/app/app.module.ngfactory' from src\main.ts
    at error (D:\DEV\mdAutocomplete - test\node_modules\rollup\dist\rollup.js:185:14)
    at then.resolvedId (D:\DEV\mdAutocomplete - test\node_modules\rollup\dist\rollup.js:9776:8)

so i changed

main.ts

import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';

to

import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory.ts';

maybe that was a mistake. Thanks for any help in advance :)

0

There are 0 answers