modules path issue on CLI 3.9.2
After update from CLI 3.8.1 to 3.9.2 I am getting error with imported modules. For example, here is an output of the error:
Error: ./src/pages/profile/edit-profile/edit-profile.ngfactory.js
Module not found: Error: Can't resolve '../../../../angularfire2/auth' in '/Users/Jayser/Documents/aplicaciones/vendeloC/src/pages/profile/edit-profile'
resolve '../../../../angularfire2/auth' in '/Users/Jayser/Documents/aplicaciones/vendeloC/src/pages/profile/edit-profile'
using description file: /Users/Jayser/Documents/aplicaciones/vendeloC/package.json (relative path: ./src/pages/profile/edit-profile)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /Users/Jayser/Documents/aplicaciones/vendeloC/package.json (relative path: ./src/pages/profile/edit-profile)
using description file: /Users/Jayser/Documents/aplicaciones/vendeloC/package.json (relative path: ./angularfire2/auth)
However, application works in browser but when I try to run in a device it gives this error.
My tsconfig.json is the following:
{
"compilerOptions": {
"baseUrl": ".",
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
@jayserdny I am getting the same error, can you share your fix?
@lostdev I just created a new project and move all my code there. It worked for me.
What causes the actual error? Can you fill out the issue template?
@dwieeb the problem seems to be related to angular fire library. After updating the CLI, I started getting this error. However, I worked around to fix this problem by moving the angulafire2 directory from node_modules to root folder. It is not the best solution, however, it allows me to continue developing my app.
For those that want to test, here are the steps to reproduce this problem:
- Create an empty Ionic 2 project.
- Install the angularfire2 library
- Initialize it.
- Run the app.
I will create a repository to reference this issue.
Sounds more like an issue with that library or your node_modules setup, not a CLI issue. May I close this?
@dwieeb sure, you can close this issue. I will open an issue in the library repo.
Library author here.
@dwieeb I'm not familiar with the build system, but it should take a look at the package.json at the import location: angularfire2/auth. This is not a deep import, it is it's own package that contains a package.json. I'm not sure why it's being transformed into a relative import: '../../../../angularfire2/auth'.
Any ideas?
It is weird that it's being converted into a relative path. Hmm.
Thanks, Dan