I have upload my project Angular on Stackblitz, the project works perfectly on Visual Studio Code.
But, when I open the project on Stackblitz, I have an error message:
Error in src/app/store/session/session.actions.ts (1:32)
Cannot find module 'src/app/services/session.response' or its corresponding type declarations.
I opened the session.action.ts file:
import { SessionReponse } from "src/app/services/session.response";
export class SessionAction {
static readonly type = '[login] connexion';
constructor(public session: SessionReponse ) { }
}
I don't understand where comes the problem, because I have the same code on Visual Studio Code.
My project on Stackblitz is here.
Thanks you very much for your help.
Don't use absolute paths like from "src/app/services/session.response";
as typescript will try to locate a module, which has much to do with how you have typescript configured in tsconfig.json
You should use relative to your project paths for components that belong to the current project. Check this in your project and you will see that the error will be eliminated
import { SessionReponse } from '../../services/session.response';
Absolute paths are recognized as modules which should exist under node_modules/
.