Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/types/single-spa-layout-interface' is not defined by "exports" in

Getting following error when run application:

Typescript version - "typescript": "4.7.2"

in package.json

"single-spa": "^5.9.3",
"single-spa-layout": "^2.0.1",
"single-spa-web-server-utils": "^2.3.1",

node version 16.13.0

import {
    constructServerLayout,
    sendLayoutHTTPResponse,
} from "single-spa-layout/dist/types/single-spa-layout-server";
 Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/types/single-spa-layout-interface' is not defined by "exports" in C:\app1\node_modules\single-spa-la
    yout\package.json
        at new NodeError (node:internal/errors:371:5)
        at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
        at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
        at resolveExports (node:internal/modules/cjs/loader:482:36)
        at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
        at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (C:\app1\node_modules\@cspotcode\source-map-suppo
    rt\source-map-support.js:811:30)
        at Function.Module._load (node:internal/modules/cjs/loader:778:27)
        at Module.require (node:internal/modules/cjs/loader:1005:19)
        at require (node:internal/modules/cjs/helpers:102:18) {
      code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

single-spa-layout has not declared that file to be importable.

The package.json lists the two possible paths:

  "exports": {
    ".": {
      "default": {
        "import": "./dist/esm/single-spa-layout.min.js",
        "require": "./dist/umd/single-spa-layout.min.cjs"
      }
    },
    "./server": {
      "node": {
        "import": "./dist/esm/single-spa-layout-server.min.js",
        "require": "./dist/umd/single-spa-layout-server.min.cjs"
      }
    }
  },

Instead of the import statement you are currently using, use:

import {
    constructServerLayout,
    sendLayoutHTTPResponse,
} from "single-spa-layout/server";
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!