I have 3 TypeScript projects below:
my-app
api
All the projects above were generated using the create-single-spa
command.
In the api/src/lomse-api.ts
file, I'm exporting the fetchPeople
module as shown below:
export { fetchPeople } from "./PeopleApi.ts";
According to the single-spa documentation, given my orgName
is lomse
and projectName
is api
, I should be able to import the fetchPeople
module into my-app
(a parcel app) like this:
import { fetchPeople } from '@lomse/api'
Since my-app
project is a TypeScript project, the statement above is definitely going to throw the error below:
Cannot find module '@lomse/api' or its corresponding type declarations.
Is there a way to fix this?
That error is a TypeScript error, not a JavaScript or single-spa error. Here are options for what you need to do:
Source: