Error AtlasError Documentation and Resolution

Node.js package import alias is not defined

Error [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier is not defined in package

A private package import beginning with # cannot be resolved from the current package's imports mapping. The mapping is scoped to that package rather than being a global alias.

ERR_PACKAGE_IMPORT_NOT_DEFINEDmodules
Error [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier is not defined in package
  • A # alias is missing or misspelled in package.json imports.
  • Code runs in a different package scope from the mapping.
  • The mapping has no applicable conditional target.
  1. Locate the package.json governing the importing file and inspect its imports field. Entries must begin with #.
  2. Correct the specifier or define the intended mapping, for example mapping #utils to ./dist/utils.js in a package you maintain.
  3. Confirm the selected conditional target exists in the deployed output and that development and production use compatible conditions.
  4. Do not assume a TypeScript or bundler alias automatically configures Node's runtime resolver. Test the compiled entry point directly with Node.
Node.js Docs: Package subpath imports