i am getting this error after trying to import "localForge":
Uncaught TypeError: Error resolving module specifier “localforage”. Relative module specifiers must start with “./”, “../” or “/”.
My tsconfig:
{ "compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"strict": false,
"noImplicitReturns": true,
"noImplicitAny": true,
"module": "es6",
"moduleResolution": "node",
"target": "es5",
"allowJs": true,
"allowSyntheticDefaultImports": true
},
"include": [
"./src/**/*"
]}
import: import * as localForage from "localforage";
also i have tried:
import { default as localForage } from "localforage";,
import localForage from "localforage";
Using node modules in the browser does not work right out of the box. Have a look at browserify for example.