Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find package src in StackBlitz after installing dependencies

Tags:

stackblitz

Well in StackBlitz says "Can't find package: src ". I've read the questions from here and I've been trying the next things:

Can't find packages in stackblitz, even though it is present in npm website. How to install then?

How to downgrade the dependencies for npm packages in StackBlitz?

They doesn't work in my case cos when i type "src" says "dependencies installed" but it comes "Can't find..." again. I tried to delete and reinstall too. Also i tried to change absolute paths to relative.

"Using absolute paths for Typescript import statements causes project to give an error. It works fine in VS Code locally, but not on Stackblitz." (from google).

So I think its not a duplicate question

https://stackblitz.com/github/NachoBFL/ScientificApp?file=src%2Fapp%2Fapp-routing.module.ts

like image 251
Nacho Avatar asked Dec 09 '18 18:12

Nacho


Video Answer


2 Answers

Hey I had the same problem when i was importing from github. The problem turned out to be... my IDE :) please make sure you do not have any import paths that start with "/src/app" and replace it with relative paths instead. Then one by one you will fix it and your Stackblitz will work.

like image 88
ortho Avatar answered Sep 20 '22 16:09

ortho


The problem for me was that when I was coding, I used Stackblitz's autoimport, and it imported the library slightly wrong. In my case it did

import { TheClass } from "@theauthor/libname/lib";

instead of just

import { TheClass } from "@theauthor/libname"; 
like image 25
CodyBugstein Avatar answered Sep 20 '22 16:09

CodyBugstein