amcdnl / ngrx-router

NGRX Router - Router Bindings and Helpers for NGRX Effects
MIT License
44 stars 1 forks source link

New 2.0.0 package is broken - Cannot find module 'ngrx-router'. #6

Closed JohannesHoppe closed 6 years ago

JohannesHoppe commented 6 years ago

Hi @amcdnl

I updated my project to NG6 and also tried to update ngrx-router from 1.0.0 to 2.0.0

The angular package format must be somewhere broken. Without much investigation I would guess it is this line in package.json:

https://github.com/amcdnl/ngrx-router/blob/6677d963e5b0fb5b9f197ef97d78df469ae5f66d/package.json#L5

There is no index.js file in the dist folder of the final npm-package, so I wonder how this ever worked for you? 😕 ❓

JohannesHoppe commented 6 years ago

So, on my disk i see for node_modules/ngrx-router/package.json

"version": "1.0.0",
"main": "bundles/ngrx-router.umd.js",

Now it looks like this

"version": "2.0.0",
"main": "dist/index.js"

Since you never changed that line in package.json at all, the reason must be related to a breaking change of ng-packagr. You might want to remove that line since the ng-packaged demo also does not contain such an entry: https://github.com/dherges/ng-packaged/blob/master/package.json

dhhyi commented 6 years ago

I think the problem is that with version 2.0.0 the whole project was published to npmjs.com and not just the dist folder:

$ ngrx-router find ngrx-router-1.0.0 -name package.json
ngrx-router-1.0.0/package/package.json

$ ngrx-router find ngrx-router-2.0.0 -name package.json
ngrx-router-2.0.0/package/package.json
ngrx-router-2.0.0/package/dist/package.json

All the imports in 2.0.0 are now only available with import X from 'ngrx-router/dist', which I think was not intended.

Can you re-publish @amcdnl ? :smiley:

amcdnl commented 6 years ago

Fixed.,