angular-seed-advanced icon indicating copy to clipboard operation
angular-seed-advanced copied to clipboard

Error on aot.rollup build. Newly cloned repo without any changes.

Open Flood opened this issue 8 years ago • 10 comments

I'm submitting a ...

[x ] bug report

Current behavior Just cloned the repo and run "npm run build.prod.rollup.aot" and get this error: { Error: 'Angulartics2' is not exported by node_modules\angulartics2\dist\index.js at error (C:\tempdev\angular-seed-advanced-project\src\angular-seed-advanced-project\angular-seed-advanced-master\node_modules\rollup\src\utils\error.js:2:14)

Expected behavior It should compile

Please tell us about your environment: Windows 10 x64 Node 6.9.5 Npm 3.10.10

Flood avatar Feb 20 '17 11:02 Flood

Maybe this will help https://github.com/angulartics/angulartics2/issues/86

sanderbos1402 avatar Feb 21 '17 15:02 sanderbos1402

Thanks but I tried that fix and it didn't help.

Flood avatar Feb 22 '17 08:02 Flood

Is it only me that have this issue? If so, it should be something with my environment. Can someone please confirm?

Flood avatar Feb 22 '17 11:02 Flood

I see the same behaviour. As the link I supplied shows it's something that is a known issue with angulartics. Rollup is tricky anyway with al the references. I hope the link will point you in the right direction for a solution, yesterday I lookup at it briefly but no solution yet. The fix worked partially for me, only causing other errors. Probably needs some trial and error tweaking to get it working, or just wait to see if this will be solved over at angulartics.

sanderbos1402 avatar Feb 22 '17 11:02 sanderbos1402

Can you test with angulartics2 v2.0.0+?

JonnyBGod avatar Apr 21 '17 22:04 JonnyBGod

@JonnyBGod It seems to work, at least it's not complaining on angulartics2 anymore. I can't really test it cause now I'm stuck with moment+aot instead.

Thank you for updating!

Flood avatar May 03 '17 12:05 Flood

Just tried a fresh seed with updated angulartics2. Now it breaks on lodash instead

C:\***\app\node_modules\lodash\lodash.js:494
      case 0: return func.call(thisArg);
                          ^
SyntaxError: Invalid or unexpected token

Anyone that has solved this issue?

Flood avatar May 04 '17 09:05 Flood

@Flood I have the same issue

drosi94 avatar May 14 '17 21:05 drosi94

AoT + rollup needs more work here - just a hint to whomever may want to tackle: https://github.com/NathanWalker/angular-seed-advanced/blob/7ceb023131775a36286a2726039e8f179067783b/tools/config/seed.config.ts#L411 It's likely some rollup named exports need to be configured and added through the project config, best overridden in seed-advanced.config.ts: https://github.com/NathanWalker/angular-seed-advanced/blob/7ceb023131775a36286a2726039e8f179067783b/tools/config/seed-advanced.config.ts since this file is the base configuration for the advanced seed. seed.config.ts is inherited directly from parent seed and project.config.ts is meant to only be handled by seed end users further customizing their projects.

NathanWalker avatar May 15 '17 01:05 NathanWalker

I am having a related issue when starting a 100% fresh seed project. I have tried both NPM and Yarn to install dependencies and both ways end up with a failed rollup aot build. Hopefully this info can help someone figure it out as this project should be able to compile without changes made to it by users.

Env: Windows 7 NPM: 3.10.10 Node: 6.10.3 Yarn: 0.24.6

{ Error: 'includes' is not exported by node_modules\lodash\lodash.js
    at error (C:\PATH\node_modules\rollup\src\utils\error.js:2:14)
    at Module.error$1 [as error] (C:\PATH\node_modules\rollup\src\Module.js:303:2)
    at Module.trace (C:\PATH\node_modules\rollup\src\Module.js:399:10)
    at ModuleScope.findDeclaration (C:\PATH\node_modules\rollup\src\ast\scopes\ModuleScope.js:52:22)
    at Scope.findDeclaration (C:\PATH\node_modules\rollup\src\ast\scopes\Scope.js:90:39)
    at Scope.findDeclaration (C:\PATH\node_modules\rollup\src\ast\scopes\Scope.js:90:39)
    at Scope.findDeclaration (C:\PATH\node_modules\rollup\src\ast\scopes\Scope.js:90:39)
    at CallExpression.bind (C:\PATH\node_modules\rollup\src\ast\nodes\CallExpression.js:8:30)
    at C:\PATH\node_modules\rollup\src\ast\Node.js:6:34
    at IfStatement.eachChild (C:\PATH\node_modules\rollup\src\ast\Node.js:21:5)
  code: 'MISSING_EXPORT',
  url: 'https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module',
  pos: 1048,
  loc:
   { file: 'C:\\PATH\\dist\\tmp\\app\\modules\\i18n\\effects\\multilingual.effect.js',
     line: 16,
     column: 9 },
  frame: '14: import { Store } from \'@ngrx/store\';\n15: import { Effect, Actions } from \'@ngrx/effects\';\n16: import { includes, map } from \'lodash\';\n
          ^\n17: import { Observable } from \'rxjs/Observable\';\n18: import \'rxjs/add/operator/map\';' }

mdirienzo avatar Jun 14 '17 14:06 mdirienzo