phenomnomnominal / angular-2-local-storage

LocalStorageService for Angular 2 with the same API as angular-local-storage
MIT License
93 stars 49 forks source link

[3.0.0] Error when run the project after build #63

Closed felipefialho closed 5 years ago

felipefialho commented 5 years ago

Hi,

I update to 3.0.0 and the project runs perfectly to serve development.

But when I generated the build, the project don't run and I get the follows error on console:

main.42b2efa0809ff1ad1245.js:1 TypeError: Cannot read property '__source' of undefined
    at t.get (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at lg (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at t.get (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at De (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at Pe (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at Re (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at vendor.3ff8dc4fe5013ffbc0c4.js:1
    at vendor.3ff8dc4fe5013ffbc0c4.js:1
    at hg (vendor.3ff8dc4fe5013ffbc0c4.js:1)
    at lg (vendor.3ff8dc4fe5013ffbc0c4.js:1)

For now I needed to install the 2.0.0 again.

I use Angular 7.2.0.

Thanks!

riede commented 5 years ago

Same for me. Using --source-map shows the following error:

core.js.pre-build-optimizer.js:15714 ERROR TypeError: Cannot read property '__source' of undefined
    at t.get (core.js.pre-build-optimizer.js:8984)
    at sg (core.js.pre-build-optimizer.js:21120)
    at t.get (core.js.pre-build-optimizer.js:21809)
    at Le (core.js.pre-build-optimizer.js:1772)
    at Ae (core.js.pre-build-optimizer.js:1777)
    at Re (core.js.pre-build-optimizer.js:1829)
    at core.js.pre-build-optimizer.js:15509
    at core.js.pre-build-optimizer.js:21182
    at ug (core.js.pre-build-optimizer.js:21140)
    at sg (core.js.pre-build-optimizer.js:21115)

I could localize the problem a little bit more. Everything works fine using Angular 7.2.2. The error occurs until Angular 7.2.3 (incl. Angular 7.2.5 that was released on 15 Feb 2019).

I created a little repro-app repository that shows the error: https://github.com/riede/anguluar-2-local-storage-repro-app

phenomnomnominal commented 5 years ago

Thank you for the repro - I'm having a dig into this now but not really getting anywhere! I thought it might be because I'm using a string to inject the config, but I fixed that and now I'm getting AOT errors... I'll keep digging, but would very much appreciate a PR if anyone can figure out a fix.

riede commented 5 years ago

In the Test-Repo I created a new branch with a basic implementation of a module that uses string injection like you do. But everything works fine. So this is not the troubling part.

riede commented 5 years ago

I think I've got a solution for our problem. I've created a new branch but I can not push it. Please set the correct rights so I can push my branch and create a Pull Request of my solution.

phenomnomnominal commented 5 years ago

Did you create a fork? I'm not sure what permissions I'm meant to set.

riede commented 5 years ago

Ahh I don‘t create a fork just cloned the repo and want to push the new branch. I will do a fork tomorrow.

EDIT: Here is my Fix ↓

phenomnomnominal commented 5 years ago

Merged the PR, released at 3.0.2 🎉

felipefialho commented 5 years ago

Tks!