ui-router / angular-hybrid

Upgrade an ng1 UI-Router app to a ng1+ng2 hybrid using ng-upgrade
MIT License
167 stars 75 forks source link

Wrong NATIVE_INJECTOR_TOKEN import #593

Closed terexas closed 10 months ago

terexas commented 10 months ago

That seems like incorrect import has been made at angular-hybrid.ts#L17 causing error "Error: export 'NATIVE_INJECTOR_TOKEN' (imported as 'NATIVE_INJECTOR_TOKEN') was not found in '@uirouter/angular' " with latest version 16.0.0.

Isn't NATIVE_INJECTOR_TOKEN exported by '@uirouter/core'?

terexas commented 10 months ago

Ah .. well, seems found the cause of missing imports. That error is caused by the newer version of typescript used in our project with typescript module set as commonjs:

package.json: "typescript": "~5.1.3" tsconfig.json: "module": "commonjs"

terexas commented 10 months ago

Closing it as there is nothing to do. The solution is quite simple - to use ESM instead of CommonJS.