When I enter the editor at Stackblitz.com and start a new Angular project, it comes with default files and folders already set up.
In the "Dependencies" section, I decide to add shortid
. So, I input that in the designated box and it begins loading the correct version. Everything seems to be going smoothly at this point.
Next, in the app.component.ts
file, my understanding is that I should be able to "import" this - but no matter how I try, I keep getting the error message "Cannot find module 'shortid'."
import * as sid from 'shortid';
import { generate } from 'shortid';
import "/node_modules/shortid";
import shortid = require("shortid");
The following example doesn't show an error, but also doesn't seem to expose any of the functionalities provided by shortid
.
import 'shortid';
Is there an issue with StackBlitz on this particular matter? Or could it be a mistake on my part?