Skip to content

"Named export DocSearch not found" error in Remix framework #2259

@pawelgalazka

Description

@pawelgalazka

Description

When importing DocSearch React component in Remix framework web app, following error is thrown when running application:

[vite] Internal server error: [vite] Named export 'DocSearch' not found. The requested module '@docsearch/react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@docsearch/react';
const {DocSearch} = pkg;

Steps to reproduce

  1. Create Remix app through npx create-remix@latest
  2. Add DocSearch import to app/routes/_index.tsx:
import { DocSearch } from '@docsearch/react';

import '@docsearch/css';
  1. Run application in dev mode: npm run dev
  2. Visit local page: http://localhost:5173/

Expected behavior

Error:

Internal server error: [vite] Named export 'DocSearch' not found.

should not be produced when running web app in Remix framework. Instead DocSearch search component should be rendered.

Environment

  • OS: Mac
  • Browser: Chrome
  • DocSearch version: 3.6.0

Metadata

Metadata

Labels

Needs investigationInvestigation is planned but not started yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions